<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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++ 4.0 crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=32445">32445</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang++ 4.0 crash
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pgsql@j-davis.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18185" name="attach_18185" title="Small example">attachment 18185</a> <a href="attachment.cgi?id=18185&action=edit" title="Small example">[details]</a></span>
Small example

This started out as a large case (preprocessed file was ~5MB) and I cut it down
with creduce. Unfortunately, it's still very sensitive to the environment so I
don't know if others will be able to reproduce it. Changing minor things, like
identifier name lengths, or even the path to the source file, allow it to
succeed.

Perhaps using a debug build or sanitizer build of clang and compiling this will
reveal the problem even if it doesn't crash on a release build.

Clang was compiled with:
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_FLAGS="-D__USE_XOPEN2K8" \
    -DCMAKE_CXX_FLAGS="-D__USE_XOPEN2K8 -O3 -march=core2 -std=gnu++11" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCLANG_ENABLE_STATIC_ANALYZER=1 \
    -DCLANG_HAVE_LIBXML=0 \
    -DLLVM_ENABLE_CXX1Y=1 \
    -DLLVM_ENABLE_RTTI=1 \
    -DLLVM_ENABLE_TERMINFO=0 \
    -DLLVM_ENABLE_ZLIB=0 \
    -DLLVM_USE_INTEL_JITEVENTS=1 \
    -DLLVM_TARGETS_TO_BUILD=X86 \
    -DLLVM_BUILD_LLVM_DYLIB=ON

and uses gcc 4.9.3.

and invoked with:
clang++ \
  -v \
  -o crash.o -c crash2.cpp \
  -std=c++11 -g \
  -flto=thin -O3 -fstrict-vtable-pointers \
  -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-sizeof-pointer-memaccess
-Wno-unused-local-typedefs \
  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-aliasing \
  > outfile 2>&1

The output contains:
...
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'crash2.cpp'.
4.      Running pass 'Global Value Numbering' on function
'@_ZL11dddd_ee_fffP1m'
clang-4.0: error: unable to execute command: Segmentation fault
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: [redacted]
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 cr\
ash 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/crash2-1f46f3.cpp
clang-4.0: note: diagnostic msg: /tmp/crash2-1f46f3.sh
clang-4.0: note: diagnostic msg:

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


The shell script in question does not actually reproduce the problem for me,
and it contains some information about my environment that I'd rather not
include in a public report, so I didn't attach those files.

If nobody else can reproduce/solve this issue, then I can put some more time in
later to narrow down exactly how to repro it outside of my environment.</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>