LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 28541 - Infinite recursion in loop vectorizer
Summary: Infinite recursion in loop vectorizer
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Loop Optimizer (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
: 28190 28716 (view as bug list)
Depends on:
Blocks: 28600
  Show dependency tree
 
Reported: 2016-07-13 14:17 PDT by Benjamin Kramer
Modified: 2016-08-12 17:48 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Kramer 2016-07-13 14:17:43 PDT
$ cat t.c
a, b, c;
fn1() {
  while (b--) {
    c = a;
    switch (a & 3)
    case 0:
    do
    case 3:
  case 2:
  case 1:
    ;
    while (--c)
      ;
  }
}

$ clang -O2 t.c
...
#8 0x00000000019ffbaa (anonymous namespace)::InnerLoopVectorizer::createBlockInMask(llvm::BasicBlock*) (bin/clang)
#9 0x0000000001a000d4 (anonymous namespace)::InnerLoopVectorizer::createEdgeMask(llvm::BasicBlock*, llvm::BasicBlock*) (bin/clang)
... repeats 100+ times ...
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 't.c'.
4.      Running pass 'Loop Vectorization' on function '@fn1'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.9.0 (trunk 275303) (llvm/trunk 275304)

The crash only occurs at -O2, the bug comes from the interaction of multiple passes.
Comment 1 Benjamin Kramer 2016-07-13 16:59:27 PDT
Bisection points at r264697.

This code is coming from real code (pygame) even though it looks like fuzzer output ;)
Comment 2 Benjamin Kramer 2016-07-27 13:52:15 PDT
*** Bug 28716 has been marked as a duplicate of this bug. ***
Comment 3 Hans Wennborg 2016-07-27 18:38:32 PDT
Sounds like this is a 3.8 -> 3.9 regression.
Comment 4 Michael Kuperstein 2016-08-10 01:10:32 PDT
*** Bug 28190 has been marked as a duplicate of this bug. ***
Comment 5 Hans Wennborg 2016-08-10 15:27:51 PDT
mkuper pointed out there's a fix up for review: http://reviews.llvm.org/D22952
Comment 6 Tim Shen 2016-08-12 17:48:31 PDT
Fixed by r278573.