<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113211>113211</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang crashes at -O0 on x86_64-linux-gnu
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bi6c
</td>
</tr>
</table>
<pre>
Compiler Explorer: https://godbolt.org/z/GYhd9EeG4
```console
fatal error: error in backend: Stack empty??
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-13.2.0 -fcolor-diagnostics -fno-crash-diagnostics -fsanitize=undefined -fsanitize=address -O0 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'X86 FP Stackifier' on function '@____strtold_l_internal'
#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 0x0000000003648113 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x3648113)
#3 0x00000000036f344e llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x36f344e)
#4 0x0000000000c855c6 (/opt/compiler-explorer/clang-19.1.0/bin/clang+0xc855c6)
#5 0x0000000003652143 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x3652143)
#6 0x00000000036522a8 (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x36522a8)
#7 0x00000000022f8ca7 (anonymous namespace)::FPS::processBasicBlock(llvm::MachineFunction&, llvm::MachineBasicBlock&) (.isra.0) X86FloatingPoint.cpp:0:0
#8 0x00000000022f926e (anonymous namespace)::FPS::runOnMachineFunction(llvm::MachineFunction&) (.part.0) X86FloatingPoint.cpp:0:0
#9 0x00000000022f9abb (anonymous namespace)::FPS::runOnMachineFunction(llvm::MachineFunction&) X86FloatingPoint.cpp:0:0
#10 0x0000000002b5181b llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#11 0x000000000309ca72 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x309ca72)
#12 0x000000000309cbf1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x309cbf1)
#13 0x000000000309e8a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x309e8a0)
#14 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)
#15 0x0000000003fce094 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x3fce094)
#16 0x0000000005f1899c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x5f1899c)
#17 0x0000000003fce825 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x3fce825)
#18 0x0000000004274201 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x4274201)
#19 0x00000000041f699b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x41f699b)
#20 0x000000000435a843 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x435a843)
#21 0x0000000000c874dc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0xc874dc)
#22 0x0000000000c8146d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#23 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
#24 0x0000000003648013 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0x3648013)
#25 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
#26 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)
#27 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)
#28 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)
#29 0x0000000000c847f1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-19.1.0/bin/clang+0xc847f1)
#30 0x0000000000b5c2d4 main (/opt/compiler-explorer/clang-19.1.0/bin/clang+0xb5c2d4)
#31 0x000070d58e029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#32 0x000070d58e029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#33 0x0000000000c80f0e _start (/opt/compiler-explorer/clang-19.1.0/bin/clang+0xc80f0e)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Compiler returned: 70
```
```c
#include <stdio.h>
#include <stdlib.h>
long double ____strtold_l_internal___x;
void ____strtold_l_internal() {
__asm__("" : "+fm"(____strtold_l_internal___x));
printf("Variable ____strtold_l_internal___x: %Lf\n", ____strtold_l_internal___x);
}
int main() {
____strtold_l_internal___x = 1.41421;
____strtold_l_internal();
return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWk1zo7jW_jVko7ILBBhYZOE48XxUT3WqnXdq3hUlxMHWbZC4kkg78-tvSYCNiJP0THvu5nalE0cf5zzn0fkChSjF9hzg1ovvvPj-hnT6IORtwVb0phDly-1GNC2rQaKHY1sLCdIL1-igdau8cO3hrYe3e1EWotZLIfce3v7p4e1P_38oswf4KfL8e89feyu__6KCK1FDP1oRTWoEUgor035AjKOC0K_ASzO204R-RdC0-sULt-bL7nz89LDePSDVFQ3TiKCi2yMJrZAaaTEHx_ShK5ZUNB7e1vXz-GPRSvEvoNrDW6ZUB8rDW0R4iRindVcC0gdAVBJ1sIC0JBQ8vEGthFYKCkpBiZToZD9sdhKlBGVEQ4lkx5GikrV62UPuLSm7pjXI7JC_9PzsUYq9JA0ict81wLUBjjy8Fa1BRgfyFzCSj7e0Jny_CLJlsPQ9vC0YHwfRYl9-I7JaRGixRwth5JC2NdI63XZ6qdCiMbajxeKYrhZENQv1wjU5euE94xp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