Open iamanonymouscs opened 5 months ago
Clang-19 with the attribute opencl_global_device enabled.
opencl_global_device
Compiler explorer(assertion trunck): https://godbolt.org/z/WKGesoejq
$cat mutant.c a(; __attribute__((opencl_global_device )) * b() { return a $clang-19 mutant.c mutant.c:1:3: error: expected parameter declarator 1 | a(; | ^ mutant.c:1:3: error: expected ')' mutant.c:1:2: note: to match this '(' 1 | a(; | ^ mutant.c:1:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] 1 | a(; | ^ | int mutant.c:2:51: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] 2 | __attribute__((opencl_global_device )) * b() { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ | int 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 -mrelax-all -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=/root/code/my_code/diff_coverage/combine_test/case_reduce -fcoverage-compilation-dir=/root/code/my_code/diff_coverage/combine_test/case_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/9/../../../../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-78f8d7.o -x c mutant.c 1. <eof> parser at end of file 2. mutant.c:2:55: parsing function body 'b' 3. mutant.c:2:55: in compound statement ('{}') #0 0x00007f7145e43216 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xdc1216) #1 0x00007f7145e40ec0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xdbeec0) #2 0x00007f7145e438f0 (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.0+0xdc18f0) #3 0x00007f7150832980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980) #4 0x00007f714df331e4 clang::Sema::DiagnoseAssignmentResult(clang::Sema::AssignConvertType, clang::SourceLocation, clang::QualType, clang::QualType, clang::Expr*, clang::Sema::AssignmentAction, bool*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x17581e4) #5 0x00007f714e0cf550 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x18f4550) #6 0x00007f714e0d634b clang::Sema::PerformCopyInitialization(clang::InitializedEntity const&, clang::SourceLocation, clang::ActionResult<clang::Expr*, true>, bool, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x18fb34b) #7 0x00007f714e22c9bf clang::Sema::PerformMoveOrCopyInitialization(clang::InitializedEntity const&, clang::Sema::NamedReturnInfo const&, clang::Expr*, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x1a519bf) #8 0x00007f714e22ecf3 clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x1a53cf3) #9 0x00007f714e22e2d1 clang::Sema::ActOnReturnStmt(clang::SourceLocation, clang::Expr*, clang::Scope*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x1a532d1) #10 0x00007f714d439e90 clang::Parser::ParseReturnStatement() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc5ee90) #11 0x00007f714d433f49 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc58f49) #12 0x00007f714d4332cb clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc582cb) #13 0x00007f714d43bc80 clang::Parser::ParseCompoundStatementBody(bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc60c80) #14 0x00007f714d43cdef clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc61def) #15 0x00007f714d456c36 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc7bc36) #16 0x00007f714d3a13a7 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+0xbc63a7) #17 0x00007f714d455cb4 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc7acb4) #18 0x00007f714d45569b clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc7a69b) #19 0x00007f714d4548ed clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc798ed) #20 0x00007f714d452d3c clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xc77d3c) #21 0x00007f714d38b11e clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0xbb011e) #22 0x00007f714f288825 clang::FrontendAction::Execute() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2aad825) #23 0x00007f714f2040d4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2a290d4) #24 0x00007f714f301f7e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.0+0x2b26f7e) #25 0x0000556391993fad cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-19/bin/clang+0x12fad) #26 0x0000556391991075 (/usr/lib/llvm-19/bin/clang+0x10075) #27 0x0000556391990213 clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-19/bin/clang+0xf213) #28 0x000055639199e556 main (/usr/lib/llvm-19/bin/clang+0x1d556) #29 0x00007f714427cc87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0 #30 0x000055639198dbfa _start (/usr/lib/llvm-19/bin/clang+0xcbfa) clang-19: error: unable to execute command: Segmentation fault (core dumped) clang-19: error: clang frontend command failed due to signal (use -v to see invocation) Ubuntu clang version 19.0.0 (++20240301064251+dd426fa5f931-1~exp1~20240301184412.1845) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-19/bin clang-19: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-19: note: diagnostic msg: /tmp/mutant-c932d2.c clang-19: note: diagnostic msg: /tmp/mutant-c932d2.sh clang-19: note: diagnostic msg: ********************
@llvm/issue-subscribers-clang-frontend
Author: Anonymous (iamanonymouscs)
@llvm/issue-subscribers-opencl
Clang-19 with the attribute
opencl_global_device
enabled.Compiler explorer(assertion trunck): https://godbolt.org/z/WKGesoejq