<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112142>112142</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang++] Attribute after last parameter at llvm::VerifierPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:X86,
crash-on-valid,
clang:frontend:fuzzer
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yijan4845
</td>
</tr>
</table>
<pre>
**This testcase is generated by a fuzzer.**
Compiler Explorer: [https://godbolt.org/z/K4zjYT7nT](https://godbolt.org/z/K4zjYT7nT)
This valid code will crash on Clang Assertion Trunk. It seems that this goes back to clang-14:
```cpp
class A {
public:
void f();
};
void g() {
void *Af = __builtin_function_start(&A::f);
}
```
Stack dump:
```
Attribute after last parameter!
ptr @_ZN1A1fEv
fatal error: error in backend: Broken module 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 -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <eof> parser at end of file
2. Optimizer
3. Running pass "verify" on module "<source>"
#0 0x0000000003baa6d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3baa6d8)
#1 0x0000000003ba839c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ba839c)
#2 0x0000000003af5b66 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3af5b66)
#3 0x0000000003b9f6be llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b9f6be)
#4 0x0000000000cd9330 LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#5 0x0000000003b00b83 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b00b83)
#6 0x0000000003b00ce8 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b00ce8)
#7 0x000000000358eec0 llvm::VerifierPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x358eec0)
#8 0x0000000003e452ee llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e452ee)
#9 0x000000000355ede0 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x355ede0)
#10 0x0000000003e54c5b (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#11 0x0000000003e5823d 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-assertions-trunk/bin/clang+++0x3e5823d)
#12 0x00000000045027ee clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45027ee)
#13 0x000000000664064c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x664064c)
#14 0x0000000004502bd8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4502bd8)
#15 0x00000000047bc4d9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47bc4d9)
#16 0x000000000473b07e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x473b07e)
#17 0x00000000048a204e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48a204e)
#18 0x0000000000cdb81f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdb81f)
#19 0x0000000000cd352a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#20 0x00000000045468a9 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 0x0000000003af5aa4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3af5aa4)
#22 0x0000000004546e9f 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 0x000000000450c7dd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x450c7dd)
#24 0x000000000450d8cd 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+++0x450d8cd)
#25 0x00000000045151f5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45151f5)
#26 0x0000000000cd86ef clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd86ef)
#27 0x0000000000ba7c44 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xba7c44)
#28 0x00007e790ba29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#29 0x00007e790ba29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#30 0x0000000000cd2fde _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd2fde)
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/eJzkWt1y47YVfhr4BiMNCVIUdeELWbaaTXcbz9rJtL3RgOChjCwIsACotfz0HYCURHDlXadjNTNtxvHKIIDzne_8ghA1hm8lwDWa3aDZ7RVt7ZPS13v-O5Vpns6uClXurxFZIrJ8fOIGWzCWUQOYG7wFCZpaKHGxxxRX7csL6Gk3GUW3KOp_r1TdcAEa3z03QmnQKFliNLt5srYxKFkiskZkvVVloYSdKr1FZP2CyPqv6cvv_3icy0c0u0Ukf_t0shiK97h3VPASM1UC_sqFwExT84SVxCtB5RYvjQFtuZL4UbfyyxR_sNgA1AbbJ2qxdVtsFRhcUPYFW4WZWzaJU4enk5VF3Q9rmm6ECWoMXmI0v-kGmrYQnB1XYLxTvMQVIrlDnPSz0Pz29Nn_9tO23bTTbv1yRJ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