[llvm-bugs] [Bug 48276] New: opt crashes with "opt -sroa -lcssa -loop-unswitch": Assertion `L->isRecursivelyLCSSAForm(*DT, *LI) && "Requested to preserve LCSSA, but it's already broken."' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Nov 23 18:46:06 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48276
Bug ID: 48276
Summary: opt crashes with "opt -sroa -lcssa -loop-unswitch":
Assertion `L->isRecursivelyLCSSAForm(*DT, *LI) &&
"Requested to preserve LCSSA, but it's already
broken."' failed.
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: suochenyao at 163.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
*******************************************************************************
OS and Platform:
CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
*******************************************************************************
Program:
int a=0;
char b(c) {
for (; 0;) {
int d=0;
c = 0;
if (d)
continue;
}
for (; 1;)
;
int e=0;
f:
if (e) {
int g=0;
if (c)
goto f;
for (; 0; b)
return 0;
} else
for (; 0;)
for (; 0; 1)
return a;
}
int main() {}
*******************************************************************************
clang version:
$ clang -v
clang version 12.0.0 (/home/suocy/src/llvm-dev/llvm-project/llvm/tools/clang
95956c1c9aae7ea21c2b2f7a21e0901d549bd190)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/suocy/bin/llvm-dev/bin
Found candidate GCC installation:
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation:
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
*******************************************************************************
How to reproduce:
$ clang -O3 -mllvm -disable-llvm-optzns -c -emit-llvm a.c -o a.bc
$ opt -sroa -lcssa -loop-unswitch a.bc -o a.opt.bc
*******************************************************************************
Command Lines:
$ clang -O3 -mllvm -disable-llvm-optzns -c -emit-llvm a.c -o a.bc
a.c:17:15: warning: expression result unused [-Wunused-value]
for (; 0; b)
^
a.c:21:17: warning: expression result unused [-Wunused-value]
for (; 0; 1)
^
2 warnings generated.
$ opt -sroa -lcssa -loop-unswitch a.bc -o a.opt.bc
opt:
/home/suocy/src/llvm-dev/llvm-project/llvm/lib/Transforms/Utils/LoopSimplify.cpp:740:
bool llvm::simplifyLoop(llvm::Loop*, llvm::DominatorTree*, llvm::LoopInfo*,
llvm::ScalarEvolution*, llvm::AssumptionCache*, llvm::MemorySSAUpdater*, bool):
Assertion `L->isRecursivelyLCSSAForm(*DT, *LI) && "Requested to preserve LCSSA,
but it's already broken."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0. Program arguments: /home/suocy/bin/llvm-dev/bin/opt -sroa -lcssa
-loop-unswitch a.bc -o a.opt.bc
1. Running pass 'Function Pass Manager' on module 'a.bc'.
2. Running pass 'Canonicalize natural loops' on function '@b'
#0 0x0000000002a7216c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/suocy/bin/llvm-dev/bin/opt+0x2a7216c)
#1 0x0000000002a6ffe4 llvm::sys::RunSignalHandlers()
(/home/suocy/bin/llvm-dev/bin/opt+0x2a6ffe4)
#2 0x0000000002a70143 SignalHandler(int)
(/home/suocy/bin/llvm-dev/bin/opt+0x2a70143)
#3 0x00007f545bb8c630 __restore_rt (/lib64/libpthread.so.0+0xf630)
#4 0x00007f545a77a387 raise (/lib64/libc.so.6+0x36387)
#5 0x00007f545a77ba78 abort (/lib64/libc.so.6+0x37a78)
#6 0x00007f545a7731a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00007f545a773252 (/lib64/libc.so.6+0x2f252)
#8 0x0000000002b4288d llvm::simplifyLoop(llvm::Loop*, llvm::DominatorTree*,
llvm::LoopInfo*, llvm::ScalarEvolution*, llvm::AssumptionCache*,
llvm::MemorySSAUpdater*, bool) (/home/suocy/bin/llvm-dev/bin/opt+0x2b4288d)
#9 0x0000000002b42b0d (anonymous
namespace)::LoopSimplify::runOnFunction(llvm::Function&)
(/home/suocy/bin/llvm-dev/bin/opt+0x2b42b0d)
#10 0x00000000022b2ac8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/suocy/bin/llvm-dev/bin/opt+0x22b2ac8)
#11 0x00000000022b3569 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/suocy/bin/llvm-dev/bin/opt+0x22b3569)
#12 0x00000000022b2373 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/suocy/bin/llvm-dev/bin/opt+0x22b2373)
#13 0x000000000072b32b main (/home/suocy/bin/llvm-dev/bin/opt+0x72b32b)
#14 0x00007f545a766555 __libc_start_main (/lib64/libc.so.6+0x22555)
#15 0x00000000007dcd95 _start (/home/suocy/bin/llvm-dev/bin/opt+0x7dcd95)
Aborted
--
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/20201124/ed99ad1a/attachment.html>
More information about the llvm-bugs
mailing list