[llvm-bugs] [Bug 33637] New: opt crashes with "opt -instcombine -jump-threading -simplifycfg -inline"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 28 19:10:51 PDT 2017


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

            Bug ID: 33637
           Summary: opt crashes with "opt -instcombine -jump-threading
                    -simplifycfg -inline"
           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 5.0.0 (trunk 306536)
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/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.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.4
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.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.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.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
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 -instcombine -jump-threading -simplifycfg -inline -o small-opt.bc
small.bc
opt:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Utils/CloneFunction.cpp:332:
void {anonymous}::PruningFunctionCloner::CloneBlock(const llvm::BasicBlock*,
llvm::BasicBlock::const_iterator, std::vector<const llvm::BasicBlock*>&):
Assertion `(!isa<Instruction>(V) || cast<Instruction>(V)->getParent() ==
nullptr || cast<Instruction>(V)->getFunction() != OldFunc || OldFunc ==
NewFunc) && "Simplified Instruction should not be in the old function."'
failed.
#0 0x0000000001e9f22a (opt+0x1e9f22a)
#1 0x0000000001e9cf9e (opt+0x1e9cf9e)
#2 0x0000000001e9d112 (opt+0x1e9d112)
#3 0x00007f1b454a6390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f1b44218428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f1b4421a02a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f1b44210bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x00007f1b44210c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000001ed0669 (opt+0x1ed0669)
#9 0x0000000001ed25bf (opt+0x1ed25bf)
#10 0x0000000001ed3f43 (opt+0x1ed3f43)
#11 0x0000000001efbc67 (opt+0x1efbc67)
#12 0x0000000001a4e9fd (opt+0x1a4e9fd)
#13 0x00000000013f1d92 (opt+0x13f1d92)
#14 0x000000000199928d (opt+0x199928d)
#15 0x00000000007b58dc (opt+0x7b58dc)
#16 0x00007f1b44203830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#17 0x00000000008200c9 (opt+0x8200c9)
Stack dump:
0.      Program arguments: opt -instcombine -jump-threading -simplifycfg
-inline -o small-opt.bc small.bc
1.      Running pass 'CallGraph Pass Manager' on module 'small.bc'.
Aborted (core dumped)
$


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


int a, b;

void fn1 ()
{ 
  for (; b < 1; b++)
    { 
      int c;
      { 
        int d;
        if (a)
          break;
      }
    }
}

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/20170629/93ed7438/attachment-0001.html>


More information about the llvm-bugs mailing list