<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60643>60643</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
latest clang on AArch64 OSX doesn't want to hear about the frame pointer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
regehr
</td>
</tr>
</table>
<pre>
referring to either FP or X29 causes an unfriendly crash using latest clang on an up-to-date ARM Macbook. the system-provided clang-1400.0.29.202 appears to be happy with this code and works as expected.
```c
__attribute__((noinline)) void test1(void) {
register unsigned long FP __asm__("fp");
__asm__ __volatile__("" : "=r" (FP));
}
```
```
Johns-MacBook-Pro:code regehr$ clang -c foo.c
Register class not supported
UNREACHABLE executed at /Users/regehr/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp:283!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -c foo.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'foo.c'.
4. Running pass 'RegBankSelect' on function '@test1'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVMSupport.dylib 0x000000010bae9708 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 libLLVMSupport.dylib 0x000000010bae858c llvm::sys::RunSignalHandlers() + 112
2 libLLVMSupport.dylib 0x000000010bae8b54 llvm::sys::CleanupOnSignal(unsigned long) + 232
3 libLLVMSupport.dylib 0x000000010b9ff124 CrashRecoverySignalHandler(int) + 168
4 libsystem_platform.dylib 0x000000018b1842a4 _sigtramp + 56
5 libsystem_pthread.dylib 0x000000018b155cec pthread_kill + 288
6 libsystem_c.dylib 0x000000018b08e2c8 abort + 180
7 libLLVMSupport.dylib 0x000000010ba115d8 llvm::install_out_of_memory_new_handler() + 0
8 libLLVMAArch64CodeGen.dylib 0x0000000100f918b8 llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(llvm::MachineInstr const&) const + 0
9 libLLVMAArch64CodeGen.dylib 0x0000000100f92a3c llvm::AArch64RegisterBankInfo::getInstrMapping(llvm::MachineInstr const&) const + 288
10 libLLVMGlobalISel.dylib 0x000000010bd2a96c llvm::RegBankSelect::assignInstr(llvm::MachineInstr&) + 468
11 libLLVMGlobalISel.dylib 0x000000010bd2ae90 llvm::RegBankSelect::assignRegisterBanks(llvm::MachineFunction&) + 340
12 libLLVMGlobalISel.dylib 0x000000010bd2b1f4 llvm::RegBankSelect::runOnMachineFunction(llvm::MachineFunction&) + 356
13 libLLVMCodeGen.dylib 0x000000010944cb2c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 616
14 libLLVMCore.dylib 0x000000010cad5e38 llvm::FPPassManager::runOnFunction(llvm::Function&) + 704
15 libLLVMCore.dylib 0x000000010cadcb68 llvm::FPPassManager::runOnModule(llvm::Module&) + 60
16 libLLVMCore.dylib 0x000000010cad640c llvm::legacy::PassManagerImpl::run(llvm::Module&) + 764
17 libclangCodeGen.dylib 0x000000010869a480 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) + 3104
18 libclangCodeGen.dylib 0x0000000108acd648 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1660
19 libclangParse.dylib 0x000000010f05ffec clang::ParseAST(clang::Sema&, bool, bool) + 724
20 libclangFrontend.dylib 0x000000010a109780 clang::FrontendAction::Execute() + 112
21 libclangFrontend.dylib 0x000000010a08bef4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 852
22 libclangFrontendTool.dylib 0x00000001033caad4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 544
23 clang-16 0x00000001006888a8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2116
24 clang-16 0x0000000100684b80 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 1004
25 libclangDriver.dylib 0x000000010a32ca6c void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) + 28
26 libLLVMSupport.dylib 0x000000010b9fee18 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 168
27 libclangDriver.dylib 0x000000010a32bdd4 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const + 224
28 libclangDriver.dylib 0x000000010a2eef7c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 504
29 libclangDriver.dylib 0x000000010a2ef334 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const + 120
30 libclangDriver.dylib 0x000000010a30ca74 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) + 340
31 clang-16 0x0000000100682e18 clang_main(int, char**) + 10096
32 dyld 0x000000018ae2be50 start + 2544
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 17.0.0 (git@github.com:llvm/llvm-project.git c32022ad260aa1e6f485c5a6820fa9973f3b108e)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Users/regehr/llvm-project/for-alive/bin
clang-16: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /var/folders/5r/c000d6715f76mgy2qrlkfrq40000gn/T/foo-6c29ca.c
clang-16: note: diagnostic msg: /var/folders/5r/c000d6715f76mgy2qrlkfrq40000gn/T/foo-6c29ca.sh
clang-16: note: diagnostic msg: Crash backtrace is located in
clang-16: note: diagnostic msg: /Users/regehr/Library/Logs/DiagnosticReports/clang-16_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-16: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang-16: note: diagnostic msg:
********************
Johns-MacBook-Pro:code regehr$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWc9zo7qT_2vIRWUXCAz4kANx7EleJS-p2PP2zV5cQjRYG5B4knDG-9dvSYANiT2T7G7tXr6uqYkttdSf_qmWmijFCg5w7cxunNntFWn0TshrCQXs5FUqssO1hBykZLxAWiBgegcSrZ6RkOhvPEeUNAoUIhw1PJcMeFYeEJVE7VCjzKKSaFAa0ZLwAgluKeuJFpOMaEDJyyN6JDQV4nWK9A6QOigN1aSWYs8yyNp1Ey9w3ak7xfMpdjEidQ1EKoMnBbQjdX1Ab0zvkN4xhajIABGeoTchXxUiCsHPGqiGbOq4t46bdP-HbvuPtr-3W6K1ZGmjYbt1cOzgmAvGS8bBwXMHz9FesAwZYTwHx-aHGXSim3Y9QhIKpjRI1HCr1AyVghdGV9stUVW3K85rB2OzpX9c2c2j7XYvSqJZ2UPADsbI8RNkvvq30v7E8eq5hXTcwolu30l1VtT25x9ix9XkkdAbIV4nz1I4fmKV1lrdwUFnrQlFuRDTTkEvvXi0JEohLjRSTV0LqSFrKb7_-bJMFnfJzcMSwU-gjYYMEY0cvPquQCoHr3oWq7LcWyv_B1Dd_TR_WOrg1YbIAsxokki6CwMHr77dr6E8jfRYbgh_vee5mNK6dvwEx76DvRbM88MyWS-RatKKaURQ2hRIgoFr_Ganda0cP3HwysGrguldk06pq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