Issue 129829
Summary UNREACHABLE executed at /root/build/tools/clang/include/clang/Sema/AttrSpellingListIndex.inc:14!
Labels clang
Assignees
Reporter bi6c
    Compiler Explorer: https://godbolt.org/z/x3hMvbd3a

```console
Ignored/unknown shouldn't get here
UNREACHABLE executed at /root/build/tools/clang/include/clang/Sema/AttrSpellingListIndex.inc:14!
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.	<source>:5:68: current parser token ';'
 #0 0x0000000003e5b938 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e5b938)
 #1 0x0000000003e595f4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e595f4)
 #2 0x0000000003da5f28 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007a77b4042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007a77b40969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007a77b4042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007a77b40287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000000003db188a (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3db188a)
 #8 0x0000000007c5f33c clang::AttributeCommonInfo::calculateAttributeSpellingListIndex() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x7c5f33c)
 #9 0x000000000743454b clang::AsmLabelAttr::getSpelling() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x743454b)
#10 0x000000000735c620 clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind, long, llvm::StringRef, llvm::StringRef, llvm::ArrayRef<std::pair<clang::DiagnosticsEngine::ArgumentKind, long>>, llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x735c620)
#11 0x0000000004090d45 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4090d45)
#12 0x0000000004b4302f clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b4302f)
#13 0x000000000409ef1e clang::DiagnosticIDs::EmitDiag(clang::DiagnosticsEngine&, clang::DiagnosticBuilder const&, clang::DiagnosticIDs::Level) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x409ef1e)
#14 0x000000000409f458 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&, clang::DiagnosticBuilder const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x409f458)
#15 0x00000000040900af clang::DiagnosticsEngine::EmitDiagnostic(clang::DiagnosticBuilder const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x40900af)
#16 0x000000000659c164 clang::Sema::EmitDiagnostic(unsigned int, clang::DiagnosticBuilder const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x659c164)
#17 0x0000000006614d48 clang::SemaBase::ImmediateDiagBuilder::~ImmediateDiagBuilder() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6614d48)
#18 0x0000000006589d03 clang::SemaBase::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6589d03)
#19 0x00000000067881bd checkNonMultiVersionCompatAttributes(clang::Sema&, clang::FunctionDecl const*, clang::FunctionDecl const*, clang::MultiVersionKind)::'lambda'(clang::Sema&, clang::Attr const*)::operator()(clang::Sema&, clang::Attr const*) const SemaDecl.cpp:0:0
#20 0x00000000067884d1 checkNonMultiVersionCompatAttributes(clang::Sema&, clang::FunctionDecl const*, clang::FunctionDecl const*, clang::MultiVersionKind) SemaDecl.cpp:0:0
#21 0x0000000006788c3f CheckMultiVersionAdditionalRules(clang::Sema&, clang::FunctionDecl const*, clang::FunctionDecl const*, bool, clang::MultiVersionKind) SemaDecl.cpp:0:0
#22 0x00000000067c905d CheckMultiVersionFunction(clang::Sema&, clang::FunctionDecl*, bool&, clang::NamedDecl*&, clang::LookupResult&) SemaDecl.cpp:0:0
#23 0x00000000067cae74 clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67cae74)
#24 0x00000000067d13b3 clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67d13b3)
#25 0x00000000067d6300 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67d6300)
#26 0x00000000067d6e40 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x67d6e40)
#27 0x000000000644068e clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x644068e)
#28 0x0000000006450239 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6450239)
#29 0x000000000640fbce clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x640fbce)
#30 0x0000000006410389 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6410389)
#31 0x0000000006417b63 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6417b63)
#32 0x0000000006418a3d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6418a3d)
#33 0x000000000640aeca clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x640aeca)
#34 0x000000000481c3a8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x481c3a8)
#35 0x0000000004ae4185 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ae4185)
#36 0x0000000004a6795e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4a6795e)
#37 0x0000000004bd2a0e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4bd2a0e)
#38 0x0000000000d4ec8f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd4ec8f)
#39 0x0000000000d465aa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#40 0x00000000048642d9 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
#41 0x0000000003da63d4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3da63d4)
#42 0x00000000048648cf 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
#43 0x00000000048274ed clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x48274ed)
#44 0x000000000482856e 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+0x482856e)
#45 0x0000000004830505 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4830505)
#46 0x0000000000d4ba83 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd4ba83)
#47 0x0000000000c133a4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc133a4)
#48 0x00007a77b4029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#49 0x00007a77b4029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#50 0x0000000000d46055 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd46055)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
Code:
```c
#pragma redefine_extname fake real
#pragma redefine_extname name alias

extern int __attribute__((target_clones("default,avx"))) fake(void);

int name;

int fish(void) { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; }
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to