<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63528>63528</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`clangtk`: fatal error: error in backend: Broken function found, compilation aborted!
</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:
```
struct a;
void b(void) {}
__attribute__((interrupt))
void c(struct a *d) { b(); }
```
When compile it using `clangtk` with option `-O0`, `clangtk` reports fatal errors in backend (verification link: https://gcc.godbolt.org/z/Pb1GvvKdY):
The output log copied from gcc.godbolt.org:
```
<source>:4:23: warning: interrupt service routine should only call a function with attribute 'no_caller_saved_registers' [-Winterrupt-service-routine]
4 | void c(struct a *d) { b(); }
| ^
<source>:2:6: note: 'b' declared here
2 | void b(void) {}
| ^
Attribute 'byval' does not support unsized types!
ptr @c
in function c
fatal error: error in backend: Broken function found, compilation aborted!
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-assertions-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 -O0 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'Module Verifier' on function '@c'
#0 0x000055d3ee35393f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c5293f)
#1 0x000055d3ee3516ac llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c506ac)
#2 0x000055d3ee29c36a llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b9b36a)
#3 0x000055d3ee3488c2 llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c478c2)
#4 0x000055d3eb7f5b7a LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#5 0x000055d3ee2a6f5a llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ba5f5a)
#6 0x000055d3ee2a70ee (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ba60ee)
#7 0x000055d3edd5ca46 (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) Verifier.cpp:0:0
#8 0x000055d3edcbd841 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x35bc841)
#9 0x000055d3edcbda89 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x35bca89)
#10 0x000055d3edcbe302 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x35bd302)
#11 0x000055d3ee5d1883 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-assertions-trunk/bin/clang+0x3ed0883)
#12 0x000055d3ef5cb70d clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4eca70d)
#13 0x000055d3f0ac56f9 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63c46f9)
#14 0x000055d3ef5c9ec8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ec8ec8)
#15 0x000055d3eee14799 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4713799)
#16 0x000055d3eed9a0e6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x46990e6)
#17 0x000055d3eeef8eb6 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f7eb6)
#18 0x000055d3eb7f702d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f602d)
#19 0x000055d3eb7f2d2a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#20 0x000055d3eebfa7ed 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
#21 0x000055d3ee29c2a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b9b2a0)
#22 0x000055d3eebfae0f 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
#23 0x000055d3eebc1f7c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c0f7c)
#24 0x000055d3eebc2a0d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c1a0d)
#25 0x000055d3eebcaaed clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c9aed)
#26 0x000055d3eb7f528a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f428a)
#27 0x000055d3eb6fb5a5 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xffa5a5)
#28 0x00007fb77cc9d083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#29 0x000055d3eb7edb0e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10ecb0e)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Compiler returned: 70
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWVtz2zjS_TXwC0oqCrw_-EGWrbl8mYor9jdT-6QCgSaFNQVwAVC259dvgReJ4MiZzK4yL5tSEom49OnTB40GQY0RlQS4RfEdiu9vaGv3St--CtBWyZtC8ffb5z1gC8YyagCFaxTco2CNkmD4dD-N1S2zmKLwrn9wVILjApHMfUEkxyi9Q-l937jbUWu1KFoLux0iGSKZkBa0bhuLSO4-50kYItk4PUZkPc7Wze66hnf4NPMMVv_vb3uQmKlDI2rAwuLWCFlhlASsprKyLygJ8Kuwe6waK5R0LYvP3SRkM-umoVHaGlxSS2sMWittsJC4oOwFJMfOYdCiFIx2U9VCvqBwjffWNsaRR7aIbCvGlpXihartUukKke3viGwfi9UPx-P_8X90Tq2nHrgQqNY2rcW1qjBTjQCOS60OeD7XBwFC4caoVjNA4QMK1xEK1yR0yF6plkK6cfgUA2xAHwUDrFVrhQRs9qqtOVayfseM1jWmuGwl61zsmDvFEyOSSrVznUDvDD0C32mohLGgDSIpRvHd4reTpcVgaTFYQvEQSIwxjjBKN_ivi6AbdvkPih8u8kFQuE4cB1JZJ3LnRuHgcmA11cDxHjScoZEztI9EPhgcoZwsr6dUFe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