https://llvm.org/bugs/show_bug.cgi?id=31014
Bug ID: 31014 Summary: Clang crashes when optimizing code using notail call to a musttail function Product: clang Version: 3.9 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: pe...@trailofbits.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17586 --> https://llvm.org/bugs/attachment.cgi?id=17586&action=edit Test case IR file that, when optimized, reproduces the bug. Command: clang -c /tmp/bug.ll -o /tmp/bug.bc -O3 -emit-llvm Backtrace: pag@sloth:/tmp$ clang -c /tmp/bug.ll -o /tmp/bug.bc -O3 -emit-llvm warning: overriding the module target triple with x86_64-unknown-linux-gnu [-Woverride-module] clang-3.9: /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:226: bool {anonymous}::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&, llvm::CallGraph&, bool): Assertion `!CheckingMode && "CallGraphSCCPass did not update the CallGraph correctly!"' failed. #0 0x00000000028132ea llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:402:0 #1 0x0000000002813689 PrintStackTraceSignalHandler(void*) /home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:470:0 #2 0x000000000281162d llvm::sys::RunSignalHandlers() /home/pag/git/llvm-3.9.0.src/lib/Support/Signals.cpp:44:0 #3 0x0000000002812a51 SignalHandler(int) /home/pag/git/llvm-3.9.0.src/lib/Support/Unix/Signals.inc:256:0 #4 0x00007f25288963e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0) #5 0x00007f2527609428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0 #6 0x00007f252760b02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0 #7 0x00007f2527601bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0 #8 0x00007f2527601c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82) #9 0x000000000376dd01 (anonymous namespace)::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&, llvm::CallGraph&, bool) /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:229:0 #10 0x000000000376d5f9 (anonymous namespace)::CGPassManager::RunPassOnSCC(llvm::Pass*, llvm::CallGraphSCC&, llvm::CallGraph&, bool&, bool&) /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:137:0 #11 0x000000000376e96f (anonymous namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&, llvm::CallGraph&, bool&) /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:420:0 #12 0x000000000376ecd8 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) /home/pag/git/llvm-3.9.0.src/lib/Analysis/CallGraphSCCPass.cpp:475:0 #13 0x00000000021d0b59 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1603:0 #14 0x00000000021d12a3 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1706:0 #15 0x00000000021d14af llvm::legacy::PassManager::run(llvm::Module&) /home/pag/git/llvm-3.9.0.src/lib/IR/LegacyPassManager.cpp:1738:0 #16 0x0000000002ae012a (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /home/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/BackendUtil.cpp:733:0 #17 0x0000000002ae02fd clang::EmitBackendOutput(clang::DiagnosticsEngine&, 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/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/BackendUtil.cpp:751:0 #18 0x000000000356b15f clang::CodeGenAction::ExecuteAction() /home/pag/git/llvm-3.9.0.src/tools/clang/lib/CodeGen/CodeGenAction.cpp:848:0 #19 0x00000000030a6656 clang::FrontendAction::Execute() /home/pag/git/llvm-3.9.0.src/tools/clang/lib/Frontend/FrontendAction.cpp:461:0 #20 0x0000000003045d04 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/pag/git/llvm-3.9.0.src/tools/clang/lib/Frontend/CompilerInstance.cpp:868:0 #21 0x00000000031f255d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/pag/git/llvm-3.9.0.src/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:241:0 #22 0x00000000016fb953 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/cc1_main.cpp:116:0 #23 0x00000000016ee392 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/driver.cpp:301:0 #24 0x00000000016eeea8 main /home/pag/git/llvm-3.9.0.src/tools/clang/tools/driver/driver.cpp:382:0 #25 0x00007f25275f4830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0 #26 0x00000000016ebac9 _start (/usr/local/bin/clang-3.9+0x16ebac9) Stack dump: 0. Program arguments: /usr/local/bin/clang-3.9 -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -main-file-name bug.ll -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -coverage-file /tmp/bug.bc -resource-dir /usr/local/bin/../lib/clang/3.9.0 -O3 -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 154 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/bug.bc -x ir /tmp/bug.ll 1. Per-module optimization passes 2. Running pass 'CallGraph Pass Manager' on module '/tmp/bug.ll'. clang-3.9: error: unable to execute command: Aborted clang-3.9: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.9.0 (tags/RELEASE_390/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/bin clang-3.9: 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-3.9: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs. -- 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