<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 -inline -instcombine -jump-threading -licm -simplifycfg -loop-unswitch -indvars": Assertion `SE->DT.dominates(ENT.ExitingBlock, Latch) && "We should only have known counts for exiting blocks that dominate " "latch!"' failed"
   href="https://bugs.llvm.org/show_bug.cgi?id=37440">37440</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -inline -instcombine -jump-threading -licm -simplifycfg -loop-unswitch -indvars": Assertion `SE->DT.dominates(ENT.ExitingBlock, Latch) && "We should only have known counts for exiting blocks that dominate " "latch!"' 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>Tested with trunk revision 332192. 


$ clangpolly -v
clang version 7.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
1064f0a9daefafcc3bb7b4d30f3a45b3b8770d99) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
0ff8dbe4d6cf215b92f1e8d8a6d1920c49daa126)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/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

$ clangpolly -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc
small.c
$ optpolly -inline -instcombine -jump-threading -licm -simplifycfg
-loop-unswitch -indvars -o small-opt.bc small.bc
optpolly:
/home/su/software/tmp/polly/llvm/lib/Analysis/ScalarEvolution.cpp:6728: const
llvm::SCEV* llvm::ScalarEvolution::BackedgeTakenInfo::getExact(const
llvm::Loop*, llvm::ScalarEvolution*, llvm::SCEVUnionPredicate*) const:
Assertion `SE->DT.dominates(ENT.ExitingBlock, Latch) && "We should only have
known counts for exiting blocks that dominate " "latch!"' failed.
Stack dump:
0.      Program arguments: optpolly -inline -instcombine -jump-threading -licm
-simplifycfg -loop-unswitch -indvars -o small-opt.bc small.bc 
1.      Running pass 'CallGraph Pass Manager' on module 'small.bc'.
2.      Running pass 'Loop Pass Manager' on function '@main'
3.      Running pass 'Induction Variable Simplification' on basic block
'%for.cond.i.outer'
LLVMSymbolizer: error reading file: No such file or directory
#0 0x000000000209cb6a (optpolly+0x209cb6a)
#1 0x000000000209a9fe (optpolly+0x209a9fe)
#2 0x000000000209ab72 (optpolly+0x209ab72)
#3 0x00007f0c7c537390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f0c7b2a9428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f0c7b2ab02a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f0c7b2a1bd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007f0c7b2a1c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x000000000168f52b (optpolly+0x168f52b)
#9 0x0000000001eade6b (optpolly+0x1eade6b)
#10 0x0000000001eb0491 (optpolly+0x1eb0491)
#11 0x00000000015fc7eb (optpolly+0x15fc7eb)
#12 0x0000000001b5024b (optpolly+0x1b5024b)
#13 0x000000000156055e (optpolly+0x156055e)
#14 0x0000000001b4fe4d (optpolly+0x1b4fe4d)
#15 0x00000000007b6967 (optpolly+0x7b6967)
#16 0x00007f0c7b294830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#17 0x0000000000845559 (optpolly+0x845559)
Aborted (core dumped)



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


int a, b;

int f (int p)
{
  return (p ^ ~2147483647) < 0 ? p : p - 2;
}

void g ()
{
  for (a = -1; a > -3; a = f (a))
    ;
  while (b++)
    ;
}

int main ()
{
  g ();
  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>