| Issue |
87957
|
| Summary |
Crash Issue during Clang-19.0.0.git Compilation Due to Recursive Call in Code
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
iamanonymouscs
|
# Command
`clang bug_1.cc`
# Code
```c
int foo(void)
{
return foo();
}
int foo() __attribute__((target("default")));
int foo() __attribute__((target("default")));
int foo() __attribute__((target("arch=core2")));
int bar()
{
return foo();
}
```
# Version
`clang --version`
```sh
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 987087df90026605fc8d03ebda5a1cd31b71e609)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
# Error Output
```sh
bug_1.cc:6:26: warning: attribute declaration must precede definition [-Wignored-attributes]
6 | int foo() __attribute__((target("default")));
| ^
bug_1.cc:1:5: note: previous definition is here
1 | int foo(void)
| ^
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: /home/cTest/llvm-project/mybuild/bin/clang-19 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name bug_1.cc -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/cTest -fcoverage-compilation-dir=/home/cTest -resource-dir /home/cTest/llvm-project/mybuild/lib/clang/19 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /home/cTest/llvm-project/mybuild/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/bug_1-0036ac.o -x c++ bug_1.cc
1. bug_1.cc:7:45: current parser token ';'
#0 0x00005591a9339bcf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x37ddbcf)
#1 0x00005591a93373d4 SignalHandler(int) Signals.cpp:0:0
#2 0x00007f01253d9420 __restore_rt (/usr/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00005591a6945de9 CheckMultiVersionAdditionalDecl(clang::Sema&, clang::FunctionDecl*, clang::FunctionDecl*, clang::MultiVersionKind, clang::CPUDispatchAttr const*, clang::CPUSpecificAttr const*, clang::TargetClonesAttr const*, bool&, clang::NamedDecl*&, clang::LookupResult&) (.cold) SemaDecl.cpp:0:0
#4 0x00005591aba2bc41 clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5ecfc41)
#5 0x00005591aba313cb clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5ed53cb)
#6 0x00005591aba34c3f clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5ed8c3f)
#7 0x00005591aba356e5 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5ed96e5)
#8 0x00005591ab6c8e5d clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b6ce5d)
#9 0x00005591ab6dcd3e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b80d3e)
#10 0x00005591ab6969c9 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b3a9c9)
#11 0x00005591ab69754e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b3b54e)
#12 0x00005591ab69fa2f clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b43a2f)
#13 0x00005591ab6a1617 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b45617)
#14 0x00005591ab69054a clang::ParseAST(clang::Sema&, bool, bool) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x5b3454a)
#15 0x00005591a9b83b55 clang::CodeGenAction::ExecuteAction() (/home/cTest/llvm-project/mybuild/bin/clang-19+0x4027b55)
#16 0x00005591a9e15191 clang::FrontendAction::Execute() (/home/cTest/llvm-project/mybuild/bin/clang-19+0x42b9191)
#17 0x00005591a9d904eb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x42344eb)
#18 0x00005591a9ef511b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/cTest/llvm-project/mybuild/bin/clang-19+0x439911b)
#19 0x00005591a6a4dced cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/cTest/llvm-project/mybuild/bin/clang-19+0xef1ced)
#20 0x00005591a6a4657d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#21 0x00005591a6a4ad96 clang_main(int, char**, llvm::ToolContext const&) (/home/cTest/llvm-project/mybuild/bin/clang-19+0xeeed96)
#22 0x00005591a6950fdb main (/home/cTest/llvm-project/mybuild/bin/clang-19+0xdf4fdb)
#23 0x00007f0124e87083 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#24 0x00005591a6a45d3e _start (/home/cTest/llvm-project/mybuild/bin/clang-19+0xee9d3e)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 987087df90026605fc8d03ebda5a1cd31b71e609)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cTest/llvm-project/mybuild/bin
clang: note: diagnostic msg:
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs