[llvm-bugs] [Bug 32836] New: opt crashes with "opt -instcombine -newgvn": Assertion `BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop completed!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 27 22:01:27 PDT 2017


http://bugs.llvm.org/show_bug.cgi?id=32836

            Bug ID: 32836
           Summary: opt crashes with "opt -instcombine -newgvn": Assertion
                    `BeforeCC->isEquivalentTo(AfterCC) && "Value number
                    changed after main loop completed!"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvm-bugs at lists.llvm.org

$ clang -v
clang version 5.0.0 (trunk 301511) (llvm/trunk 301510)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.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.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang -w -c -emit-llvm -o small.bc small.c
$ opt -instcombine -newgvn -o small-opt.bc small.bc
opt: /tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/NewGVN.cpp:2613:
void {anonymous}::NewGVN::verifyIterationSettled(llvm::Function&): Assertion
`BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop
completed!"' failed.
#0 0x0000000001e54b9a (opt+0x1e54b9a)
#1 0x0000000001e52cbe (opt+0x1e52cbe)
#2 0x0000000001e52e20 (opt+0x1e52e20)
#3 0x00007f6e7df0a330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f6e7ccf3c37 gsignal
/build/eglibc-MjiXCM/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f6e7ccf7028 abort
/build/eglibc-MjiXCM/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f6e7ccecbf6 __assert_fail_base
/build/eglibc-MjiXCM/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f6e7ccecca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001d3e81b (opt+0x1d3e81b)
#9 0x0000000001d3f987 (opt+0x1d3f987)
#10 0x00000000019a3a23 (opt+0x19a3a23)
#11 0x00000000019a3acc (opt+0x19a3acc)
#12 0x00000000019a430a (opt+0x19a430a)
#13 0x0000000000840307 (opt+0x840307)
#14 0x00007f6e7ccdef45 __libc_start_main
/build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:321:0
#15 0x000000000089b709 (opt+0x89b709)
Stack dump:
0.      Program arguments: opt -instcombine -newgvn -o small-opt.bc small.bc
1.      Running pass 'Function Pass Manager' on module 'small.bc'.
2.      Running pass 'Global Value Numbering' on function '@fn1'
Aborted (core dumped)
$


-------------------------


struct
{ 
  int a:29;
} b;

int c, d, e, f, g;
short h;

void fn1 ()
{ 
  int j = 8;
  if (e)
    { 
      j = b.a;
    L:;
    }
  b.a = j;
  f || g;
  short l = c | b.a;
  l || 0;
  if (d)
    goto L;
  h = l;
}

int main ()
{ 
  fn1 ();
  return 0;
}

-- 
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/20170428/176fc636/attachment-0001.html>


More information about the llvm-bugs mailing list