[llvm-bugs] [Bug 40422] New: opt crashes with "opt -gvn -correlated-propagation -indvars": Assertion `!L || L->contains(LI->getLoopFor(InsertPt->getParent()))' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 23 01:23:33 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40422

            Bug ID: 40422
           Summary: opt crashes with "opt -gvn -correlated-propagation
                    -indvars": Assertion `!L ||
                    L->contains(LI->getLoopFor(InsertPt->getParent()))'
                    failed.
           Product: libraries
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: cszide at 163.com
                CC: llvm-bugs at lists.llvm.org

$ clang -v
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/jack-zhou/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$clang -O3 -c -emit-llvm  -mllvm -disable-llvm-optzns small.c -o small.bc
-I"path to csmith's runtime"

$ opt -gvn -correlated-propagation -indvars small.bc -o small-opt.bc
LLVMSymbolizer: error reading file: No such file or directory
#0 0x0000000001a68794 (opt+0x1a68794)
#1 0x0000000001a68a76 (opt+0x1a68a76)
#2 0x00007f31530a0890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#3 0x0000000001639070 (opt+0x1639070)
#4 0x000000000076ec64 (opt+0x76ec64)
#5 0x00000000018b0a40 (opt+0x18b0a40)
#6 0x00000000018b6b83 (opt+0x18b6b83)
#7 0x00000000011c0618 (opt+0x11c0618)
#8 0x00000000016021eb (opt+0x16021eb)
#9 0x0000000001602453 (opt+0x1602453)
#10 0x0000000001602858 (opt+0x1602858)
#11 0x000000000075b292 (opt+0x75b292)
#12 0x00007f3151f73b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#13 0x000000000074c1b9 (opt+0x74c1b9)
Stack dump:
0.      Program arguments: opt -gvn -correlated-propagation -indvars small.bc
-o small-opt.bc 
1.      Running pass 'Function Pass Manager' on module 'crash18.bc'.
2.      Running pass 'Loop Pass Manager' on function '@c'
3.      Running pass 'Induction Variable Simplification' on basic block '%19'
Segmentation fault (core dumped)

The following is the source code of small.c, which is generated by csmith and
reduced by creduce.

#include "csmith.h"
a;
b[][1];
static const int64_t c(int32_t, d, const *, *, uint8_t);
e() { f(c); }
const int64_t c(int32_t g, d, const *h, *i, uint8_t l) {
  uint32_t j;
  for (j = 0; j; j++) {
    int32_t k;
    if (b[0][0]) {
      uint32_t n;
      if (b[j + 1])
        return d;
    } else {
      int32_t m;
      for (; 3;)
        return a;
    }
    b[j + 1];
  }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190123/3462c5f5/attachment.html>


More information about the llvm-bugs mailing list