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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Using -mno-sse2 with 19.1.0 results in frontend command failure
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    While investigating #118152 , I noticed that compiling below code with `clang -mno-sse2` causes compiler to crash.

```
#include <cstdio>
#include <x86intrin.h>

void func(__m128 v) {
        float f[4]; _mm_store_ps(f, v);
        printf("%6.3f %6.3f %6.3f %6.3f", f[0], f[1], f[2], f[3]);
}
```

For some strange reason, modifying the whitespaces seem to change the outcome (details at the end). Please refer to the Compiler Explorer sample for the exact code: https://godbolt.org/z/3Y3xoefnG

The error log:

```
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-19.1.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-14.2.0 -fcolor-diagnostics -fno-crash-diagnostics -mno-sse2 <source>
1.      <eof> parser at end of file
2.      Code generation
 #0 0x00000000036fdb08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x36fdb08)
 #1 0x00000000036fbc74 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x36fbc74)
 #2 0x0000000003647be8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007408ae242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00000000045a4d62 llvm::DwarfCompileUnit::getOrCreateContextDIE(llvm::DIScope const*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x45a4d62)
 #5 0x00000000045a59b7 llvm::DwarfCompileUnit::getOrCreateImportedEntityDIE(llvm::DIImportedEntity const*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x45a59b7)
 #6 0x000000000452c9df llvm::DwarfDebug::endModule() (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x452c9df)
 #7 0x00000000044f655d llvm::AsmPrinter::doFinalization(llvm::Module&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x44f655d)
 #8 0x0000000003091d4d llvm::FPPassManager::doFinalization(llvm::Module&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3091d4d)
 #9 0x000000000309e558 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x309e558)
#10 0x0000000003996531 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>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3996531)
#11 0x0000000003fce094 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3fce094)
#12 0x0000000005f1899c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x5f1899c)
#13 0x0000000003fce825 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3fce825)
#14 0x0000000004274201 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x4274201)
#15 0x00000000041f699b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x41f699b)
#16 0x000000000435a843 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x435a843)
#17 0x0000000000c874dc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0xc874dc)
#18 0x0000000000c8146d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#19 0x0000000004017309 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
#20 0x0000000003648013 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3648013)
#21 0x0000000004017529 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
#22 0x0000000003fdd947 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3fdd947)
#23 0x0000000003fde2fd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3fde2fd)
#24 0x0000000003fe7d4c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0x3fe7d4c)
#25 0x0000000000c847f1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0xc847f1)
#26 0x0000000000b5c2d4 main (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0xb5c2d4)
#27 0x00007408ae229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#28 0x00007408ae229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#29 0x0000000000c80f0e _start (/opt/compiler-explorer/clang-19.1.0/bin/clang+++0xc80f0e)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```

Reproduces with trunk and 19.1.0. Not observed with 18 or earlier.

Starting from the [Compiler Explorer sample](https://godbolt.org/z/3Y3xoefnG), removing blank line between include and function made the code compile successfully. Trunk clang also compiles OK when all indentation tabs are replaced with whitespaces, but 19.1.0 still showed error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWU9z47YV_zTwBSMNCZISefBBlq1k06TrWTnt9KQBgUcJXRBgAVCW8-k7ACmTlO1N0irpoTveMU0AD7_3e3-lR60VewVwi7I7lN3f0NYdtLm1B6EqflNq_nL794OQgIU6gnViT51Qe4xIEsd5nBGMyBp_wko7wYBjd6AOM103QvptJUj9jJnmgJ-FO2C0iJikao9ntdIza4GgRYQZbS3Y_hgY7DRmhtrDHEUr_7OI-p9ohUgiFJMtB4ySNbOOC42Shzcrp3whlDNCzQ_9crQ6asFx1SqGSL7b1THJ8RGRAqPlXdhQVFJThyuU3aUou0fJHd7V9c46bWDXWETyyivrz6CkP9IYoVyFSI4IQSRbzJMKf_A77FgH8ZEX3z_Ho2cyek7C8_mm5f0lEdFqow22ugZsnaFqD9gAtVp5AbXmonrxFnAHwM8H4cA2lIHFFqAOBB_CEb-sW8e8GERyDo4KaTF1YQUUR6SY40cJ1Hr5VWcdv7Y-W-vh1EhtwGBL60YCrrTpDp8oc8H2KFnhg3ONRckKkQ0im73mpZZurs0ekc0viGySfyQnDZX6rtPtyQswRhss9d4fe-MJjz8-rLYP2LZlLRymuGz32ECjjfMIL64T7tCWc6ZrRDZSHs-_Zo3R_wT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