<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/129904>129904</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang frontend failed at clang::ASTContext::forEachMultiversionedFunctionVersion()
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</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/qPxYh9Td4
```console
<source>:10:58: error: parameter 'b' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
10 | int __attribute__((target_clones("default,avx"))) foo(a, b)
| ^
11 | struct foo a;
12 | {
<source>:10:51: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
10 | int __attribute__((target_clones("default,avx"))) foo(a, b)
| ^
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. Per-file LLVM IR generation
#0 0x0000000003e62338 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e62338)
#1 0x0000000003e5fff4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e5fff4)
#2 0x0000000003dac928 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x0000762533c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000000000735a4ce clang::ASTContext::forEachMultiversionedFunctionVersion(clang::FunctionDecl const*, llvm::function_ref<void (clang::FunctionDecl*)>) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x735a4ce)
#5 0x000000000442bd2d clang::CodeGen::CodeGenModule::emitMultiVersionFunctions() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x442bd2d)
#6 0x000000000442dff8 clang::CodeGen::CodeGenModule::Release() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x442dff8)
#7 0x000000000482760e (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#8 0x0000000004823f75 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4823f75)
#9 0x000000000641621c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x641621c)
#10 0x0000000004824728 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4824728)
#11 0x0000000004aec505 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4aec505)
#12 0x0000000004a6fcde clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4a6fcde)
#13 0x0000000004bdad8e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4bdad8e)
#14 0x0000000000d4f5cf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd4f5cf)
#15 0x0000000000d46eea ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#16 0x000000000486c659 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
#17 0x0000000003dacdd4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3dacdd4)
#18 0x000000000486cc4f 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
#19 0x000000000482f86d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x482f86d)
#20 0x00000000048308ee 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+0x48308ee)
#21 0x0000000004838885 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4838885)
#22 0x0000000000d4c3c3 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd4c3c3)
#23 0x0000000000c13ae4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc13ae4)
#24 0x0000762533c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x0000762533c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x0000000000d46995 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd46995)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
Code:
```c
#define int unsigned
struct foo {
int aa : 1;
int a : 9;
int c : 16;
int d : 6;
};
int __attribute__((target_clones("default,avx"))) foo(a, b)
struct foo a;
{
return a.d == 0;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkWV9z27gR_zTwC4YaCvwj8sEP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