Issue 239483
Summary [clang][OpenACC][objective-c++] Assertion `type->isIntegerType() && "Illegal type in IntegerLiteral"' failed.
Labels clang:frontend, crash-on-invalid, objective-c++, clang:openacc, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/j7YjK3efv
```cpp
void foo() {
  typename <> bar;
#pragma acc parallel reduction(max: bar)
 ;
}
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/AST/Expr.cpp:977: clang::IntegerLiteral::IntegerLiteral(const clang::ASTContext&, const llvm::APInt&, clang::QualType, clang::SourceLocation): Assertion `type->isIntegerType() && "Illegal type in IntegerLiteral"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -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 -x objective-c++ -fopenacc <source>
1.	<source>:3:41: at annotation token
2.	<source>:1:12: parsing function body 'foo'
3.	<source>:1:12: in compound statement ('{}')
 #0 0x0000000004f0d918 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f0d918)
 #1 0x0000000004f0ab74 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f0ab74)
 #2 0x0000000004f0b1ac llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f0b1ac)
 #3 0x0000000004e44f28 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x00007734c9a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x00007734c9a9ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #6 0x00007734c9a4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x00007734c9a288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x00007734c9a2881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x00007734c9a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x000000000a36ae64 clang::IntegerLiteral::Create(clang::ASTContext const&, llvm::APInt const&, clang::QualType, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xa36ae64)
#11 0x000000000976c46a (anonymous namespace)::GenerateReductionInitRecipeExpr(clang::ASTContext&, clang::SourceRange, clang::QualType, (anonymous namespace)::InitKind) SemaOpenACC.cpp:0:0
#12 0x00000000097744b1 clang::SemaOpenACC::CreateReductionInitRecipe(clang::OpenACCReductionOperator, clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x97744b1)
#13 0x000000000979dba6 (anonymous namespace)::SemaOpenACCClauseVisitor::VisitReductionClause(clang::SemaOpenACC::OpenACCParsedClause&) SemaOpenACCClause.cpp:0:0
#14 0x00000000097a42c1 (anonymous namespace)::SemaOpenACCClauseVisitor::Visit(clang::SemaOpenACC::OpenACCParsedClause&) SemaOpenACCClause.cpp:0:0
#15 0x00000000097a5906 clang::SemaOpenACC::ActOnClause(llvm::ArrayRef<clang::OpenACCClause const*>, clang::SemaOpenACC::OpenACCParsedClause&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x97a5906)
#16 0x0000000008fb9447 clang::Parser::ParseOpenACCClauseParams(llvm::ArrayRef<clang::OpenACCClause const*>, clang::OpenACCDirectiveKind, clang::OpenACCClauseKind, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fb9447)
#17 0x0000000008fbb2e5 clang::Parser::ParseOpenACCClause(llvm::ArrayRef<clang::OpenACCClause const*>, clang::OpenACCDirectiveKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fbb2e5)
#18 0x0000000008fbc26a clang::Parser::ParseOpenACCClauseList(clang::OpenACCDirectiveKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fbc26a)
#19 0x0000000008fbc72e clang::Parser::ParseOpenACCDirective() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fbc72e)
#20 0x0000000008fbec2c clang::Parser::ParseOpenACCDirectiveStmt() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fbec2c)
#21 0x00000000090afecf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90afecf)
#22 0x00000000090b0cd6 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90b0cd6)
#23 0x00000000090b92ae clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90b92ae)
#24 0x00000000090b9a9a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x90b9a9a)
#25 0x0000000008fafb4e clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fafb4e)
#26 0x0000000008ffbd46 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+++0x8ffbd46)
#27 0x0000000008fa371b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fa371b)
#28 0x0000000008fa3f5f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fa3f5f)
#29 0x0000000008fb0e78 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fb0e78)
#30 0x0000000008fb1d75 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fb1d75)
#31 0x0000000008fb2180 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fb2180)
#32 0x0000000008f8dd3c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f8dd3c)
#33 0x0000000005a090c8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a090c8)
#34 0x0000000005d314d8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5d314d8)
#35 0x0000000005cbdf4d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5cbdf4d)
#36 0x0000000005e07b33 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e07b33)
#37 0x0000000001716cf8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1716cf8)
#38 0x000000000170dbda ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#39 0x000000000170dd63 int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#40 0x0000000005a812b9 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 0x0000000004e45324 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4e45324)
#42 0x0000000005a81e25 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 0x0000000005a3ec42 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a3ec42)
#44 0x0000000005a41efc 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+++0x5a41efc)
#45 0x0000000005a4e3f5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a4e3f5)
#46 0x000000000171332a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x171332a)
#47 0x0000000001688dc3 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1688dc3)
#48 0x00007734c9a2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#49 0x00007734c9a2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#50 0x000000000170d585 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x170d585)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Program terminated with signal SIGABRT (6)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to