<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 integrated aarch64 assembler crashes with segfault"
   href="https://llvm.org/bugs/show_bug.cgi?id=27302">27302</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang integrated aarch64 assembler crashes with segfault
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>LLVM assembly language parser
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hxy9243@gmail.com
          </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=16197" name="attach_16197" title="The reduced assembly file that causes the clang segfault.">attachment 16197</a> <a href="attachment.cgi?id=16197&action=edit" title="The reduced assembly file that causes the clang segfault.">[details]</a></span>
The reduced assembly file that causes the clang segfault.

Clang with aarch64 backend crashes when trying to compile CoreMark benchmark,
which has inline ARM assembly. Following is the clang version and stderr
output.

I've attached the reduced main assembly file as attachment.

Clang is trunk version as of 04/07, with revision r265744.


   $CC -cc1as -triple aarch64-sarc-linux-gnu -filetype obj -o main.o
main_reduced.s
0  libLLVMSupport.so  0x00007f46e9076e25
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVMSupport.so  0x00007f46e9074bc6 llvm::sys::RunSignalHandlers() + 54
2  libLLVMSupport.so  0x00007f46e9074db3
3  libc.so.6          0x00007f46e74ecd40
4  libLLVMMC.so       0x00007f46e98b8ad4
llvm::MCDwarfFrameEmitter::Emit(llvm::MCObjectStreamer&, llvm::MCAsmBackend*,
bool) + 5636
5  libLLVMMC.so       0x00007f46e98be030 llvm::MCELFStreamer::FinishImpl() + 64
6  libLLVMMCParser.so 0x00007f46e965a757
7  clang-3.9          0x0000000000410f11
8  clang-3.9          0x000000000041431b cc1as_main(llvm::ArrayRef<char
const*>, char const*, void*) + 8251
9  clang-3.9          0x000000000040d7c4 main + 8132
10 libc.so.6          0x00007f46e74d7ec5 __libc_start_main + 245
11 clang-3.9          0x000000000040a7d9
Stack dump:
0.      Program arguments:
/sarc-c/compiler_tmp/tools/cross/llvm-3.9/2016-04-07-23-10-14-d11e1a4-master/bin/clang-3.9
-cc1as -triple aarch64-sarc-linux-gnu -filetype obj -o main.o main1.s
1.      Program arguments: -triple aarch64-sarc-linux-gnu -filetype obj -o
main.o main1.s
0  libLLVMSupport.so  0x00007f46e9076e25
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVMSupport.so  0x00007f46e9074bc6 llvm::sys::RunSignalHandlers() + 54
2  libLLVMSupport.so  0x00007f46e9074db3
3  libc.so.6          0x00007f46e74ecd40
4  libLLVMMC.so       0x00007f46e98b8ad4
llvm::MCDwarfFrameEmitter::Emit(llvm::MCObjectStreamer&, llvm::MCAsmBackend*,
bool) + 5636
5  libLLVMMC.so       0x00007f46e98be030 llvm::MCELFStreamer::FinishImpl() + 64
6  libLLVMMCParser.so 0x00007f46e965a757
7  clang-3.9          0x0000000000410f11
8  clang-3.9          0x000000000041431b cc1as_main(llvm::ArrayRef<char
const*>, char const*, void*) + 8251
9  clang-3.9          0x000000000040d7c4 main + 8132
10 libc.so.6          0x00007f46e74d7ec5 __libc_start_main + 245
11 clang-3.9          0x000000000040a7d9
[1]    11609 segmentation fault (core dumped)  $CC -cc1as -triple
aarch64-sarc-linux-gnu -filetype obj -o main.o main.s</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>