<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58536>58536</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ARM][Assembler] Certain .arch directives crash LLVM
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
easyaspi314
</td>
</tr>
</table>
<pre>
On certain targets, the ARM assembler will ICE with certain `.arch` versions.
This seems to apply to
- armv7ve
- armv7s
- armv8.1-m.main
- armv8-r
but I haven't tested them all.
https://godbolt.org/z/85na617v4
Compile with `llvm-mc --triple=arm-none-eabi` or `clang --target=arm-none-eabi`.
```asm
.arch armv7ve
```
```
LLVM ERROR: Unknown Arch: armv7ve
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/llvm-mc -filetype=obj -o example.o --triple=arm-none-eabi <source>
#0 0x000056037ed2b3b4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000056037ed290b4 SignalHandler(int) Signals.cpp:0:0
#2 0x00007f0873b5e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007f087363100b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007f0873610859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x000056037e66f8e1 (/opt/compiler-explorer/clang-trunk/bin/llvm-mc+0x4918e1)
#6 0x000056037e90c358 (anonymous namespace)::ARMTargetELFStreamer::finishAttributeSection() ARMELFStreamer.cpp:0:0
#7 0x000056037e904815 (anonymous namespace)::ARMELFStreamer::finishImpl() ARMELFStreamer.cpp:0:0
#8 0x000056037ec1d075 llvm::MCStreamer::finish(llvm::SMLoc) (/opt/compiler-explorer/clang-trunk/bin/llvm-mc+0xa3f075)
#9 0x000056037ec87c59 (anonymous namespace)::AsmParser::Run(bool, bool) AsmParser.cpp:0:0
#10 0x000056037e676008 main (/opt/compiler-explorer/clang-trunk/bin/llvm-mc+0x498008)
#11 0x00007f0873612083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#12 0x000056037e6aeb4e _start (/opt/compiler-explorer/clang-trunk/bin/llvm-mc+0x4d0b4e)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVltvozgY_TXkxQIZzPUhD5k01VZqNVUzs6-RbZzgqcHINpl0f_1-hvRCtqPpTiMC-HbO-S72B9P10_Jrh7gwjsoOOWoOwtkgWSPXCLR6uEPUWtEyJQz6KZVCN-sNvLjmZUmQ44ga3sATHYWxUnc2CvBVgFfT_VsjLbJCtBY5jWjfqyd4mcZQiKhpj8VRzNt21iyjOGyjFtjm3aGZ2mxw6AY19Ci6ICkccsI6UXsLWkSVOqtpnOttQFZBcg3XQddMKxdpc4DWP_Avs47mcXFM34pf67aXSkwmg4lKHduw5SgMnZG9EgG5AilhpzsRCsqk94I2fiZXtDv4eaNL35n37KQcTxe17dQzunPul5dJb7VddN7e_n2HNg8PXx_ASPS9e-z0zw6tfGigPYO7v92sthtkB9ZKhyhiwwEZ0WvjfIguHAWWDyziuoWGN__8CHujfwjuoCmtHQQkzTWiXY1kx9VQizGBuKG2QYzyR2coF2eTtw46UD20vWcZu7w3qnujD4ZCzMxhaEXnvAgEsLr3LHwKhQnFqVfaCOP7vJMhFEP3CC0GCXIW50O0h9nuqfcx0uwHCjUSJ9pC0CL9y_ihgKytHgyHkc0524KEYIRPGH5Zjkkh6oQRlqJ7Izs32vLNG7eVh46qv8AFymsrj1rWQQJerNA0ZCPee4vx-H_Bji-wKwzYl2DA9Fug5AxU7HFZEJaJNMFotzOwG8BdOwguAHkHSQb3U5nv8jRUshtO4aEbpoHeNUbQOrI6wkHyBZ_iFFCA-pWGzGhyEmPMkKHSig_gc4-cj8gpgYUz5HSOHOMyqxBl-kPK3yA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