<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63569>63569</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang crashes when all `xmm` registers are clobbered
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          wierton
      </td>
    </tr>
</table>

<pre>
    The testcase (compiled with `clang small.c`):
```
void a(float b) {
  asm ("" : "=v" (b) : : "xmm0", "xmm1", "xmm2", "xmm3",
                         "xmm4", "xmm5", "xmm6", "xmm7",
                         "xmm8", "xmm9", "xmm10", "xmm11",
                         "xmm12", "xmm13", "xmm14", "xmm15");
}
```

Compiler Explorer: https://gcc.godbolt.org/z/TTMr599x3

Compiler's version:
```
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 12e9c7aaa66b7624b5d7666ce2794d912bf9e4b7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk/bin
Compiler returned: 0
```

Compiler's crash recovery:
```
<source>:2:8: error: inline assembly requires more registers than available
    2 |   asm ("" : "=v" (b) : : "xmm0", "xmm1", "xmm2", "xmm3",
      | ^
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: /opt/compiler-explorer/clang-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '<source>'.
4.      Running pass 'X86 Assembly Printer' on function '@a'
 #0 0x000055fd91cb989f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362e89f)
 #1 0x000055fd91cb78cc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x362c8cc)
 #2 0x000055fd91c07588 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f2076e00420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000055fd90bd9419 llvm::X86ATTInstPrinter::printRegName(llvm::raw_ostream&, llvm::MCRegister) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x254e419)
 #5 0x000055fd90bd978b llvm::X86ATTInstPrinter::printOperand(llvm::MCInst const*, unsigned int, llvm::raw_ostream&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x254e78b)
 #6 0x000055fd90bdbe03 llvm::X86ATTInstPrinter::printInstruction(llvm::MCInst const*, unsigned long, llvm::raw_ostream&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x2550e03)
 #7 0x000055fd90bdcd65 llvm::X86ATTInstPrinter::printInst(llvm::MCInst const*, unsigned long, llvm::StringRef, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x2551d65)
 #8 0x000055fd919b7f66 llvm::MCTargetStreamer::prettyPrintAsm(llvm::MCInstPrinter&, unsigned long, llvm::MCInst const&, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x332cf66)
 #9 0x000055fd9195dea3 (anonymous namespace)::MCAsmStreamer::emitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&) MCAsmStreamer.cpp:0:0
#10 0x000055fd908777a1 llvm::X86AsmPrinter::emitInstruction(llvm::MachineInstr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x21ec7a1)
#11 0x000055fd929a6e77 llvm::AsmPrinter::emitFunctionBody() (/opt/compiler-explorer/clang-trunk/bin/clang+0x431be77)
#12 0x000055fd9086a085 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x21df085)
#13 0x000055fd91133df0 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x000055fd9165765a llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x2fcc65a)
#15 0x000055fd916577e9 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x2fcc7e9)
#16 0x000055fd916583d0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x2fcd3d0)
#17 0x000055fd91f25740 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::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x389a740)
#18 0x000055fd92e564d9 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x47cb4d9)
#19 0x000055fd94213919 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5b88919)
#20 0x000055fd92e555ad clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x47ca5ad)
#21 0x000055fd92730f21 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x40a5f21)
#22 0x000055fd926b6353 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x402b353)
#23 0x000055fd92811ec3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4186ec3)
#24 0x000055fd8f52d91c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea291c)
#25 0x000055fd8f528fdf ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#26 0x000055fd92507f5d void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#27 0x000055fd91c07a07 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x357ca07)
#28 0x000055fd925083fc clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#29 0x000055fd924cf2be clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e442be)
#30 0x000055fd924cfc8d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e44c8d)
#31 0x000055fd924da35c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3e4f35c)
#32 0x000055fd8f52b4df clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xea04df)
#33 0x000055fd8f4277c5 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xd9c7c5)
#34 0x00007f20768ae083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#35 0x000055fd8f5252be _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xe9a2be)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWtuS4yjSfhrVDWEHAh0v6sLtKv_TE9N_d3TVbsydA0HKZlsCD6A67NNvIMkHVK7DTFXPXmyHu2xECr78MpNMkJi1cqMALqP0U5ReXbDObbW5vJdgnFYXlRaPl7dbQA6s48wCikjBdbuTDQh0L90WRRnmDVMbZFvWNHMeZTgiZUQXEb6K8MI3h0_fvNNSIBaRom40c6iKSImi_NPQiRCzrZ8hIiQiBEV0gfxPenXXN0kxyPvLQ9dD2-JeeDm24qBFghYdWiMuXA6fsTMJRNOglQWt_KVhikC0DLFNoMYvDRSH2GMaNkO48YC3jOjIZJRfnaV_-LscDGjQ9cOu0QaMZ3Pr3M56s5FVRFYbzucbLSrduLk2m4is_h2R1e3tF5OW5QM9N1pEcovuwFip1XPmHzxlFEJxPsdz7O06mVy6bVfNuW4jsmqau_3XbGf0v4C7-UY6FBMoec4Yy7Iqz0hSpSLPsowDyctElDGp6hKSKve09HPfMrMB51V9KLJ1lsw69UPpezVrpOoeZhvVjXJbA0ygVgtovPROW_kwdH1W1rGmAXElzeCBK71zEVmNIWFmsGeUrHpdZ8xaME5qZWfOdOpHRFaVVBM7GHCdUSD8mPgNhuup5obZLTLA9R2Yx-cYj-jS6s5wiOh1RBckoovCTwPG6F4HqRqpAHmcbdU8IgN_dNKARa02gAxspHVgLHJbphC7Y7JhVQP7gEWIoChfor8zdFH_z88apdfDpW-_XS9urpHtqlY6xFDVbZCBnTYOOT117Ve8KyIraW0HNiIrxJRAUvGmE4DcFkbSK8Z_OMM4eIQ7AzujOVgLAo1ck2V_J7NWc8kcCGQ6hSw3cufmA-Qbx_gPJLp2dzAdnke4_Gb0xrAWMbPpWlDOvtHRTr1rvIZmG3HPTD1L0GyDZtoPw3Y7P1jndp2bWzS7QbPZhvOZ07rhWyZVRK9enM0Ll3Myx2hWc91oMxOSbZS2TnKLZrXSs56k4HLghb2usdc1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