<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="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"
   href="https://bugs.llvm.org/show_bug.cgi?id=34783">34783</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -globals-aa -licm -loop-unswitch -indvars": Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>su@cs.ucdavis.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is tested with rev. 314493. 


$ clangpolly -v
clang version 6.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
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; 
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>