<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang segfaults on loop-versioning-licm and O2"
   href="https://llvm.org/bugs/show_bug.cgi?id=28584">28584</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang segfaults on loop-versioning-licm and O2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>matthias.krueger@famsik.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16752" name="attach_16752" title="files that clang wanted me to attach">attachment 16752</a> <a href="attachment.cgi?id=16752&action=edit" title="files that clang wanted me to attach">[details]</a></span>
files that clang wanted me to attach

llvm @ 4fe9cc7cb0ee93f8796936f316524f0524d8f110
git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@275678">https://llvm.org/svn/llvm-project/llvm/trunk@275678</a>
91177308-0d34-0410-b5e6-96231b3b80d8

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


I tried to compile this file:
<a href="https://github.com/danmar/cppcheck/blob/768c26805c2f761a19e752fc391e073186abb75e/lib/checkio.cpp">https://github.com/danmar/cppcheck/blob/768c26805c2f761a19e752fc391e073186abb75e/lib/checkio.cpp</a>

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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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: 

********************</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>