<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 on atomics/builtins when optimization is enabled"
   href="https://llvm.org/bugs/show_bug.cgi?id=30535">30535</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash on atomics/builtins when optimization is enabled
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>martin@martin.st
          </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>When compiling C++ code for Windows/ARM that refers to atomics/builtins (only
inline functions that aren't actually called, in the the MSVC C++ headers),
clang crashes when optimization is enabled.

#0 0x00000000013e1df8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/martin/clang-trunk/bin/clang-4.0+0x13e1df8)
#1 0x00000000013dfdbe llvm::sys::RunSignalHandlers()
(/home/martin/clang-trunk/bin/clang-4.0+0x13dfdbe)
#2 0x00000000013dff0c SignalHandler(int)
(/home/martin/clang-trunk/bin/clang-4.0+0x13dff0c)
#3 0x00007eff7c5b73d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x113d0)
#4 0x0000000000d19030 (anonymous
namespace)::GlobalMerge::doInitialization(llvm::Module&)
(/home/martin/clang-trunk/bin/clang-4.0+0xd19030)
#5 0x0000000000ffd5b2 llvm::FPPassManager::doInitialization(llvm::Module&)
[clone .localalias.403] (/home/martin/clang-trunk/bin/clang-4.0+0xffd5b2)
#6 0x0000000001008a22 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/martin/clang-trunk/bin/clang-4.0+0x1008a22)
#7 0x000000000154ed09 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/martin/clang-trunk/bin/clang-4.0+0x154ed09)
#8 0x0000000001b01899
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/martin/clang-trunk/bin/clang-4.0+0x1b01899)
#9 0x0000000001e73c78 clang::ParseAST(clang::Sema&, bool, bool)
(/home/martin/clang-trunk/bin/clang-4.0+0x1e73c78)
#10 0x0000000001852e5e clang::FrontendAction::Execute()
(/home/martin/clang-trunk/bin/clang-4.0+0x1852e5e)
#11 0x0000000001824246
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/martin/clang-trunk/bin/clang-4.0+0x1824246)
#12 0x00000000018d4c82
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/martin/clang-trunk/bin/clang-4.0+0x18d4c82)
#13 0x00000000008acf48 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/martin/clang-trunk/bin/clang-4.0+0x8acf48)
#14 0x000000000086ae1d main (/home/martin/clang-trunk/bin/clang-4.0+0x86ae1d)
#15 0x00007eff7b315830 __libc_start_main
/build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:325:0
#16 0x00000000008ab0c9 _start (/home/martin/clang-trunk/bin/clang-4.0+0x8ab0c9)
Stack dump:
0.      Program arguments: /home/martin/clang-trunk/bin/clang-4.0 -cc1 -triple
thumbv7--windows-msvc18.0.0 -emit-obj -mincremental-linker-compatible
-disable-free -disable-llvm-verifier -discard-value-names -main-file-name
test.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -target-cpu cortex-a9
-target-feature +strict-align -target-abi aapcs -mfloat-abi hard
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/martin/code/clang-arm-cpp/test.gcno -resource-dir
/home/martin/clang-trunk/bin/../lib/clang/4.0.0 -D
WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -internal-isystem
/home/martin/clang-trunk/bin/../lib/clang/4.0.0/include -internal-isystem
/home/martin/msvc2013/vc/include -internal-isystem
/home/martin/msvc2013/phonekits/8.1/include -internal-isystem
/home/martin/msvc2013/phonekits/8.1/include/abi -internal-isystem
/home/martin/msvc2013/phonekits/8.1/include/mincore -internal-isystem
/home/martin/msvc2013/phonekits/8.1/include/minwin -internal-isystem
/home/martin/msvc2013/phonekits/8.1/include/wrl -O2 -fdeprecated-macro
-fdebug-compilation-dir /home/martin/code/clang-arm-cpp -ferror-limit 19
-fmessage-length 157 -fallow-half-arguments-and-returns -backend-option
-arm-restrict-it -fms-extensions -fms-compatibility
-fms-compatibility-version=18 -std=c++11 -fno-threadsafe-statics
-fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o test.o -x c++ test.cpp 
1.      <eof> parser at end of file
2.      Code generation
clang-4.0: error: unable to execute command: Segmentation fault (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (<a href="http://llvm.org/git/clang">http://llvm.org/git/clang</a>
37a34bf1aa320cc702528fa19beb2ada2a80652f) (<a href="http://llvm.org/git/llvm">http://llvm.org/git/llvm</a>
cb7fbfed01ffc8da1d6d1f686b1b12f5299a3147)
Target: armv7--windows-msvc
Thread model: posix
InstalledDir: /home/martin/clang-trunk/bin
clang-4.0: 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-4.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-4.0: note: diagnostic msg: /tmp/test-0e7fec.cpp
clang-4.0: note: diagnostic msg: /tmp/test-0e7fec.sh
clang-4.0: 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>