[llvm-bugs] [Bug 37440] 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

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 13 15:48:37 PDT 2018


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

            Bug ID: 37440
           Summary: 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
           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

Tested with trunk revision 332192. 


$ clangpolly -v
clang version 7.0.0 (http://llvm.org/git/clang.git
1064f0a9daefafcc3bb7b4d30f3a45b3b8770d99) (http://llvm.org/git/llvm.git
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;
}

-- 
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/20180513/1b1523cd/attachment.html>


More information about the llvm-bugs mailing list