[llvm-bugs] [Bug 28584] New: clang segfaults on loop-versioning-licm and O2

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 16 06:29:00 PDT 2016


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

            Bug ID: 28584
           Summary: clang segfaults on loop-versioning-licm and O2
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matthias.krueger at famsik.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16752
  --> https://llvm.org/bugs/attachment.cgi?id=16752&action=edit
files that clang wanted me to attach

llvm @ 4fe9cc7cb0ee93f8796936f316524f0524d8f110
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275678
91177308-0d34-0410-b5e6-96231b3b80d8

clang @ a29693086ca0a0182832157dfb234a4a6135370e
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275679
91177308-0d34-0410-b5e6-96231b3b80d8


I tried to compile this file:
https://github.com/danmar/cppcheck/blob/768c26805c2f761a19e752fc391e073186abb75e/lib/checkio.cpp

with 

/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang++ -Ilib
-Iexternals/tinyxml   -O2 -std=c++0x   -mllvm -enable-loop-versioning-licm   -c
-o lib/checkio.o lib/checkio.cpp 

which caused a segfault.
The clang/llvm version that crashed was a build optimized for performance.

#0 0x0000000000e9ac85 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xe9ac85)
#1 0x0000000000e9b2e6 SignalHandler(int)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xe9b2e6)
#2 0x00007f7433d7bc30 __restore_rt (/lib64/libpthread.so.0+0x10c30)
#3 0x00000000008aaeb4 llvm::LoopBase<llvm::BasicBlock,
llvm::Loop>::getExitBlocks(llvm::SmallVectorImpl<llvm::BasicBlock*>&) const
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x8aaeb4)
#4 0x0000000000ed363a
llvm::formLCSSAForInstructions(llvm::SmallVectorImpl<llvm::Instruction*>&,
llvm::DominatorTree&, llvm::LoopInfo&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xed363a)
#5 0x0000000000ed45d2 llvm::formLCSSA(llvm::Loop&, llvm::DominatorTree&,
llvm::LoopInfo*, llvm::ScalarEvolution*)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xed45d2)
#6 0x0000000000ed469f llvm::formLCSSARecursively(llvm::Loop&,
llvm::DominatorTree&, llvm::LoopInfo*, llvm::ScalarEvolution*)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xed469f)
#7 0x0000000000ed4681 llvm::formLCSSARecursively(llvm::Loop&,
llvm::DominatorTree&, llvm::LoopInfo*, llvm::ScalarEvolution*)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xed4681)
#8 0x0000000000ed4f81 (anonymous
namespace)::LCSSAWrapperPass::runOnFunction(llvm::Function&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xed4f81)
#9 0x0000000000b9d8af llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xb9d8af)
#10 0x0000000000b9da9b llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xb9da9b)
#11 0x0000000000b9de8a llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xb9de8a)
#12 0x0000000000fbe793 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/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0xfbe793)
#13 0x0000000001527145
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x1527145)
#14 0x000000000186c826 clang::ParseAST(clang::Sema&, bool, bool)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x186c826)
#15 0x00000000012a81fc clang::FrontendAction::Execute()
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x12a81fc)
#16 0x0000000001276278
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x1276278)
#17 0x000000000131c828
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x131c828)
#18 0x00000000006e5eb9 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x6e5eb9)
#19 0x00000000006e4bdd main
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x6e4bdd)
#20 0x00007f74328d3731 __libc_start_main (/lib64/libc.so.6+0x20731)
#21 0x00000000006e2139 _start
(/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9+0x6e2139)
Stack dump:
0.    Program arguments:
/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name checkio.cpp -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
/home/matthias/vcs/github/cppcheck_fast/NOSAN_clang/lib/checkio.o -resource-dir
/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/../lib/clang/3.9.0 -I lib -I
externals/tinyxml -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../include/c++/6.1.1
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../include/c++/6.1.1/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../include/c++/6.1.1/backward
-internal-isystem /usr/local/include -internal-isystem
/home/matthias/LLVM/LLVM_pure/stage_2/build/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-std=c++0x -fdeprecated-macro -fdebug-compilation-dir
/home/matthias/vcs/github/cppcheck_fast/NOSAN_clang -ferror-limit 19
-fmessage-length 316 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-mllvm -enable-loop-versioning-licm -o lib/checkio.o -x c++ lib/checkio.cpp 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Function Pass Manager' on module 'lib/checkio.cpp'.
4.    Running pass 'Loop-Closed SSA Form Pass' on function
'@_ZN7CheckIO17checkFormatStringEPK5TokenS2_S2_bb'
clang-3.9: error: unable to execute command: Segmentation fault
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (/home/matthias/LLVM/LLVM_pure/stage_1//llvm/tools/clang
a29693086ca0a0182832157dfb234a4a6135370e)
(/home/matthias/LLVM/LLVM_pure/stage_1//llvm
4fe9cc7cb0ee93f8796936f316524f0524d8f110)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/matthias/LLVM/LLVM_pure/stage_2/build/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: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/checkio-07c073.cpp
clang-3.9: note: diagnostic msg: /tmp/checkio-07c073.sh
clang-3.9: note: diagnostic msg: 

********************

-- 
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/20160716/65b8352d/attachment-0001.html>


More information about the llvm-bugs mailing list