[llvm-bugs] [Bug 34783] New: opt crashes with "opt -globals-aa -licm -loop-unswitch -indvars": Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 29 10:54:16 PDT 2017


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

            Bug ID: 34783
           Summary: opt crashes with "opt -globals-aa -licm -loop-unswitch
                    -indvars": Assertion `New->getType() == getType() &&
                    "replaceAllUses of value with new value of different
                    type!"' failed
           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

This is tested with rev. 314493. 


$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
2fb39644fd947db828c0d8ecf36edd2d387dac8c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/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
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc
small.c
$ optpolly -globals-aa -licm -loop-unswitch -indvars -o small-opt.bc small.bc
optpolly: /home/su/software/tmp/polly/llvm/lib/IR/Value.cpp:402: void
llvm::Value::doRAUW(llvm::Value*, bool): Assertion `New->getType() == getType()
&& "replaceAllUses of value with new value of different type!"' failed.
LLVMSymbolizer: error reading file: No such file or directory
#0 0x0000000001f42e6a (optpolly+0x1f42e6a)
#1 0x0000000001f4100e (optpolly+0x1f4100e)
#2 0x0000000001f41170 (optpolly+0x1f41170)
#3 0x00007f67617cc330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f67605b4c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f67605b8028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f67605adbf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f67605adca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001ab90f6 (optpolly+0x1ab90f6)
#9 0x0000000002016e7e (optpolly+0x2016e7e)
#10 0x0000000001d74844 (optpolly+0x1d74844)
#11 0x0000000001d77033 (optpolly+0x1d77033)
#12 0x0000000001597833 (optpolly+0x1597833)
#13 0x0000000001a76cdb (optpolly+0x1a76cdb)
#14 0x0000000001a76d8c (optpolly+0x1a76d8c)
#15 0x0000000001a779ea (optpolly+0x1a779ea)
#16 0x000000000089c026 (optpolly+0x89c026)
#17 0x00007f676059ff45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#18 0x000000000090980a (optpolly+0x90980a)
Stack dump:
0.      Program arguments: optpolly -globals-aa -licm -loop-unswitch -indvars
-o small-opt.bc small.bc 
1.      Running pass 'Function Pass Manager' on module 'small.bc'.
2.      Running pass 'Loop Pass Manager' on function '@fn2'
3.      Running pass 'Induction Variable Simplification' on basic block
'%for.cond1.us'
Aborted (core dumped)
$ 


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


int a, b, c;

int fn1 () { return 0; }

void fn2 ()
{
  int *e = 0;
  for (; c; )
    for (; a; a = fn1 ())
      if (b)
        e = 0;
  e;
}

int main ()
{
  fn2 ();
  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/20170929/31d6c9e2/attachment.html>


More information about the llvm-bugs mailing list