<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 --- - crash in optimizer" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23678&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=JNYNkSRg2kdkvTROjV9ImdgLAB5OvPKVAr66mitZyDU&s=8EQp-qDGGQpH9TKFIhMW1DwdSEdhzQaGyin2VTfvo7k&e=">23678</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash in optimizer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mark@artillery.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Just found a crash in clang that seems to be in the optimizer. The crash
reproduces at -O2 and -O3, but not at -O1. It also reproduces if the opt tool
is run on a .bc file emitted by the compiler without optimizations.

Here's the trace:

0  clang                    0x00000001058e8bf9 void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
10777
1  clang                    0x00000001058e935b void
std::__1::seed_seq::generate<unsigned int*>(unsigned int*, unsigned int*) +
12667
2  libsystem_platform.dylib 0x00007fff869dff1a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000106271a00 _sigtramp + 2139691776
4  clang                    0x0000000104ad6d8d
llvm::SmallVectorTemplateBase<std::__1::unique_ptr<llvm::GlobalVariable,
std::__1::default_delete<llvm::GlobalVariable> >, false>::grow(unsigned long) +
12909
5  clang                    0x00000001055c98b8
std::__1::__tree<std::__1::__value_type<llvm::Function const*,
llvm::CallGraphNode*>, std::__1::__map_value_compare<llvm::Function const*,
std::__1::__value_type<llvm::Function const*, llvm::CallGraphNode*>,
std::__1::less<llvm::Function const*>, true>,
std::__1::allocator<std::__1::__value_type<llvm::Function const*,
llvm::CallGraphNode*> >
<span class="quote">>::destroy(std::__1::__tree_node<std::__1::__value_type<llvm::Function const*,</span >
llvm::CallGraphNode*>, void*>*) + 2728
6  clang                    0x00000001058798e8 void
llvm::DeleteContainerSeconds<llvm::DenseMap<llvm::Type*, llvm::UndefValue*,
llvm::DenseMapInfo<llvm::Type*>, llvm::detail::DenseMapPair<llvm::Type*,
llvm::UndefValue*> > >(llvm::DenseMap<llvm::Type*, llvm::UndefValue*,
llvm::DenseMapInfo<llvm::Type*>, llvm::detail::DenseMapPair<llvm::Type*,
llvm::UndefValue*> >&) + 32296
7  clang                    0x0000000103c8ceaa void
std::__1::vector<clang::serialization::ModuleFile*,
std::__1::allocator<clang::serialization::ModuleFile*>
<span class="quote">>::__push_back_slow_path<clang::serialization::ModuleFile*</span >
const&>(clang::serialization::ModuleFile* const&&&) + 9450
8  clang                    0x0000000103d8ebf2
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject>,
llvm::detail::DenseMapPair<clang::BaseSubobject, unsigned long long> >,
false>::grow(unsigned long) + 27570
9  clang                    0x0000000103e10dc4 void
std::__1::vector<clang::CodeGen::LValue,
std::__1::allocator<clang::CodeGen::LValue>
<span class="quote">>::__push_back_slow_path<clang::CodeGen::LValue const&>(clang::CodeGen::LValue</span >
const&&&) + 1236
10 clang                    0x0000000103ae247e
std::__1::__tree<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>,
std::__1::__map_value_compare<clang::edit::FileOffset,
std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>, std::__1::less<clang::edit::FileOffset>,
true>, std::__1::allocator<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit> >
<span class="quote">>::destroy(std::__1::__tree_node<std::__1::__value_type<clang::edit::FileOffset,</span >
clang::edit::EditedSource::FileEdit>, void*>*) + 5630
11 clang                    0x0000000103ab4833 void
std::__1::vector<clang::FrontendInputFile,
std::__1::allocator<clang::FrontendInputFile>
<span class="quote">>::__push_back_slow_path<clang::FrontendInputFile</span >
const&>(clang::FrontendInputFile const&&&) + 20851
12 clang                    0x0000000103a777f6 void
std::__1::__tree_balance_after_insert<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*,
std::__1::__tree_node_base<void*>*) + 4022
13 clang                    0x0000000103a6f029
14 clang                    0x0000000103a739d0 void
std::__1::vector<llvm::SourceMgr::SrcBuffer,
std::__1::allocator<llvm::SourceMgr::SrcBuffer>
<span class="quote">>::__push_back_slow_path<llvm::SourceMgr::SrcBuffer>(llvm::SourceMgr::SrcBuffer&&)</span >
+ 2048
15 libdyld.dylib            0x00007fff8b0b05c9 start + 1
Stack dump:
0.    Program arguments: /Users/mlogan/toolchain/clang+llvm-3.6.0/bin/clang
-cc1 -triple x86_64-apple-macosx10.10.0 -emit-llvm-bc -disable-free
-disable-llvm-verifier -main-file-name native-bindings.cpp -mrelocation-model
pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 241.9
-dwarf-column-info -coverage-file
/Users/mlogan/artillery/projects/atlas/game/CPP/build-x86_64-apple-darwin/native-bindings.bc
-resource-dir /Users/mlogan/toolchain/clang+llvm-3.6.0/bin/../lib/clang/3.6.0
-I entity-lib/../third-party/glm -I entity-lib/../third-party/crc32 -I
build-x86_64-apple-darwin -I ../../../../local/include -I
../../../../native-client/deps/SDL2/include -I . -I Lib -I entity-lib -I
ThirdParty/box2d.js/Box2D_v2.2.1 -I ../../../../native-client/src -I
../../../../native-client/deps/io.js/deps/v8/include -stdlib=libc++ -O2
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/Users/mlogan/artillery/projects/atlas/game/CPP -ferror-limit 19
-fmessage-length 176 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o
build-x86_64-apple-darwin/native-bindings.bc -x c++
build-x86_64-apple-darwin/native-bindings.cpp
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module
'build-x86_64-apple-darwin/native-bindings.cpp'.
clang: error: unable to execute command: Floating point exception: 8
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 (tags/RELEASE_360/final)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_bugs_&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=JNYNkSRg2kdkvTROjV9ImdgLAB5OvPKVAr66mitZyDU&s=p7WyNQQToSn2mLpdmRpJ-3OdLbS7jnZToCrmQJnmcIw&e=">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg:
/var/folders/4j/95xx1xm16xn20mqgqv4jd_xc0000gn/T/native-bindings-2ac66c.cpp
clang: note: diagnostic msg:
/var/folders/4j/95xx1xm16xn20mqgqv4jd_xc0000gn/T/native-bindings-2ac66c.sh
clang: 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>