| Issue |
115490
|
| Summary |
clang-20 crashed with no_caller_saved_registers attribute. Assertion `At && "Received null Attr object!"' failed.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
iamanonymouscs
|
clang-20 crashed with ```no_caller_saved_registers``` attribute .
Compiler explorer: https://godbolt.org/z/bKoP3zT4j
```
$cat mutant.c
int a();
int __attribute__((no_caller_saved_registers)) b();
__typeof(b) a;
Reduced by Creduce.
Also crashed on clang-19.
$clang-19 mutant.c
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: /usr/lib/llvm-19/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mutant.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/code/reduce -fcoverage-compilation-dir=/home/code/reduce -resource-dir /usr/lib/llvm-19/lib/clang/19 -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/mutant-bb858a.o -x c mutant.c
1. mutant.c:3:14: current parser token ';'
#0 0x00007fa81efce246 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xea7246)
#1 0x00007fa81efcbe20 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xea4e20)
#2 0x00007fa81efce90b (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xea790b)
#3 0x00007fa81dc06520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007fa826b720d1 clang::Attr::getSpelling() const (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xeb90d1)
#5 0x00007fa826a299c8 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>) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xd709c8)
#6 0x00007fa826766752 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xaad752)
#7 0x00007fa8289cf44c clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2d1644c)
#8 0x00007fa82676c3f4 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xab33f4)
#9 0x00007fa8267660b2 clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xaad0b2)
#10 0x00007fa82722080e clang::Sema::EmitCurrentDiagnostic(unsigned int) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x156780e)
#11 0x00007fa8272abfb9 clang::SemaBase::ImmediateDiagBuilder::~ImmediateDiagBuilder() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x15f2fb9)
#12 0x00007fa82722133b clang::SemaBase::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x156833b)
#13 0x00007fa8273b01c8 clang::Sema::MergeFunctionDecl(clang::FunctionDecl*, clang::NamedDecl*&, clang::Scope*, bool, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x16f71c8)
#14 0x00007fa8273cc8c3 clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x17138c3)
#15 0x00007fa8273bf8eb clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x17068eb)
#16 0x00007fa8273bb438 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x1702438)
#17 0x00007fa8273ba918 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x1701918)
#18 0x00007fa826901390 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc48390)
#19 0x00007fa8268ff0e6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc460e6)
#20 0x00007fa8269bd987 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xd04987)
#21 0x00007fa8269bd33b clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xd0433b)
#22 0x00007fa8269bc547 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xd03547)
#23 0x00007fa8269baa27 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xd01a27)
#24 0x00007fa8268e87de clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc2f7de)
#25 0x00007fa82897b0b5 clang::FrontendAction::Execute() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2cc20b5)
#26 0x00007fa8288eb2f4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2c322f4)
#27 0x00007fa8289f7dee clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2d3edee)
#28 0x0000560b7f6f1bc5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-19/bin/clang+0x11bc5)
#29 0x0000560b7f6eead5 (/usr/lib/llvm-19/bin/clang+0xead5)
#30 0x0000560b7f6edc9b clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-19/bin/clang+0xdc9b)
#31 0x0000560b7f6fbf36 main (/usr/lib/llvm-19/bin/clang+0x1bf36)
#32 0x00007fa81dbedd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x00007fa81dbede40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x0000560b7f6ec765 _start (/usr/lib/llvm-19/bin/clang+0xc765)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 19.0.0 (++20240722031324+65825cd5431c-1~exp1~20240722151445.1819)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/mutant-c62a1c.c
clang: note: diagnostic msg: /tmp/mutant-c62a1c.sh
clang: note: diagnostic msg:
********************
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs