https://bugs.llvm.org/show_bug.cgi?id=35969
Bug ID: 35969
Summary: clang crashes at -O1 and above: : Assertion `SuccTN &&
"Unreachable successor found at reachable insertion"'
failed.
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangb...@nondot.org
Reporter: helloqi...@gmail.com
CC: llvm-bugs@lists.llvm.org
As the title.
$ clang-trunk -v
clang version 7.0.0 (trunk 322539)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
$ clang-trunk -O1 abc.c
abc.c:34:3: warning: expression result unused [-Wunused-value]
i;
^
clang-7.0:
/home/absozero/trunk/llvm/include/llvm/Support/GenericDomTreeConstruction.h:786:
static void
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::VisitInsertion(DomTreeT&,
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::BatchUpdatePtr,
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::TreeNodePtr, unsigned int,
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::TreeNodePtr,
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::InsertionInfo&) [with DomTreeT =
llvm::DominatorTreeBase<llvm::BasicBlock, false>;
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::BatchUpdatePtr =
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*;
llvm::DomTreeBuilder::SemiNCAInfo<DomTreeT>::TreeNodePtr =
llvm::DomTreeNodeBase<llvm::BasicBlock>*; typename DomTreeT::NodeType =
llvm::BasicBlock]: Assertion `SuccTN && "Unreachable successor found at
reachable insertion"' failed.
#0 0x00000000021829ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x21829ea)
#1 0x000000000218088e llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x218088e)
#2 0x00000000021809e2 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x21809e2)
#3 0x00007fd89aaed330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fd89966ac37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fd89966e028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fd899663bf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fd899663ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001c4d9dc
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::VisitInsertion(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*, llvm::DomTreeNodeBase<llvm::BasicBlock>*, unsigned
int, llvm::DomTreeNodeBase<llvm::BasicBlock>*,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::InsertionInfo&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c4d9dc)
#9 0x0000000001c4db6f
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::InsertReachable(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*, llvm::DomTreeNodeBase<llvm::BasicBlock>*,
llvm::DomTreeNodeBase<llvm::BasicBlock>*)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c4db6f)
#10 0x0000000001c4e1f0
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::InsertEdge(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*, llvm::BasicBlock*, llvm::BasicBlock*)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c4e1f0)
#11 0x0000000001c4e404
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyNextUpdate(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c4e404)
#12 0x0000000001c525aa
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyUpdates(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::ArrayRef<llvm::DomTreeBuilder::Update<llvm::BasicBlock*> >)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c525aa)
#13 0x0000000001c52770 llvm::DeferredDominance::flush()
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c52770)
#14 0x0000000001fb5720 llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DeferredDominance*, bool, std::unique_ptr<llvm::BlockFrequencyInfo,
std::default_delete<llvm::BlockFrequencyInfo> >,
std::unique_ptr<llvm::BranchProbabilityInfo,
std::default_delete<llvm::BranchProbabilityInfo> >)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1fb5720)
#15 0x0000000001fb6550 (anonymous
namespace)::JumpThreading::runOnFunction(llvm::Function&) [clone .part.626]
[clone .constprop.643]
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1fb6550)
#16 0x0000000001c97253 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c97253)
#17 0x000000000171149e (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x171149e)
#18 0x0000000001c96ded llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x1c96ded)
#19 0x0000000002340fce clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x2340fce)
#20 0x0000000002b8ea97
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x2b8ea97)
#21 0x0000000002d6fca8 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x2d6fca8)
#22 0x0000000002b8de4c clang::CodeGenAction::ExecuteAction()
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x2b8de4c)
#23 0x00000000027104ce clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x27104ce)
#24 0x00000000026de676
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x26de676)
#25 0x00000000027a4133
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x27a4133)
#26 0x0000000000a6e218 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-7.0+0xa6e218)
#27 0x00000000009e60ee main
(/home/absozero/trunk/root-clang/bin/clang-7.0+0x9e60ee)
#28 0x00007fd899655f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#29 0x0000000000a6a319 _start
(/home/absozero/trunk/root-clang/bin/clang-7.0+0xa6a319)
Stack dump:
0. Program arguments: /home/absozero/trunk/root-clang/bin/clang-7.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name abc.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir
/home/absozero/trunk/root-clang/lib/clang/7.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir /home/absozero/projects/reduction/crash -ferror-limit
19 -fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/abc-eed6a0.o -x c abc.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'abc.c'.
4. Running pass 'Jump Threading' on function '@fn1'
clang-7.0: error: unable to execute command: Aborted (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 322539)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-7.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7.0: note: diagnostic msg: /tmp/abc-7fcce5.c
clang-7.0: note: diagnostic msg: /tmp/abc-7fcce5.sh
clang-7.0: note: diagnostic msg:
********************
$ cat abc.c
long a, b, c, d, e, f, g;
char h;
short i;
void fn1() {
long j;
for (; e;) {
f *= f || a % b;
if (1 < e) {
for (; c <= 4; j++)
l1:
for (; c <= 50;)
;
for (; c;) {
l2:
goto l1;
l3:
l4:
if (b ?: (d = j))
goto l3;
}
e = 5;
for (; e; e++) {
g = 2;
for (; g;)
;
}
}
if (j)
goto l2;
l5:
for (; h;)
goto l4;
}
i;
goto l5;
}
int main() {}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs