[llvm-bugs] [Bug 33961] New: opt crashes with "opt -sroa -jump-threading -loop-deletion"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 27 00:04:11 PDT 2017


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

            Bug ID: 33961
           Summary: opt crashes with "opt -sroa -jump-threading
                    -loop-deletion"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvm-bugs at lists.llvm.org

$ clang -v
clang version 6.0.0 (trunk 309139)
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 -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ opt -sroa -jump-threading -loop-deletion -o small-opt.bc small.bc
While deleting: i32 %
Use still stuck around after Def is destroyed:  %f.0 = phi i32 [ 0, %entry ], [
<badref>, %while.end9 ]
opt: /tmp/llvm-builder/llvm-source-trunk/lib/IR/Value.cpp:86:
llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is
destroyed!"' failed.
#0 0x0000000001f428ea (opt+0x1f428ea)
#1 0x0000000001f40a7e (opt+0x1f40a7e)
#2 0x0000000001f40be0 (opt+0x1f40be0)
#3 0x00007f8c37be7330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f8c369cfc37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f8c369d3028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f8c369c8bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f8c369c8ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001aae2db (opt+0x1aae2db)
#9 0x0000000001aae3f0 (opt+0x1aae3f0)
#10 0x00000000019b6216 (opt+0x19b6216)
#11 0x00000000019b7705 (opt+0x19b7705)
#12 0x0000000001d906b8 (opt+0x1d906b8)
#13 0x0000000001d92739 (opt+0x1d92739)
#14 0x000000000155b95b (opt+0x155b95b)
#15 0x0000000001a6b863 (opt+0x1a6b863)
#16 0x0000000001a6b90c (opt+0x1a6b90c)
#17 0x0000000001a6c5aa (opt+0x1a6c5aa)
#18 0x00000000007e936b (opt+0x7e936b)
#19 0x00007f8c369baf45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#20 0x000000000084878a (opt+0x84878a)
Stack dump:
0.      Program arguments: opt -sroa -jump-threading -loop-deletion -o
small-opt.bc small.bc
1.      Running pass 'Function Pass Manager' on module 'small.bc'.
2.      Running pass 'Loop Pass Manager' on function '@fn1'
3.      Running pass 'Delete dead loops' on value 'Segmentation fault (core
dumped)
$


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


int a, b, c, d;

void fn1 ()
{ 
  int f = 0;
L:
  if (f)
    for (d = 0; d;)
      if (((f = c) || 1) & 0)
        { 
          while (b)
            while (a)
              ;
          goto 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/20170727/08904f12/attachment.html>


More information about the llvm-bugs mailing list