Issue 238155
Summary [clang][AArch64] Assertion `(T->hasIntegerRepresentation() || T->isEnumeralType() || T->isFixedPointType()) && "Unexpected type"' failed.
Labels backend:AArch64, clang:frontend, crash-on-invalid, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/83cTWToP5
```cpp
class C {};

void foo(C *bar) {
  __clang_svint32x4_t *baz;
  baz = bar;
}
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/AST/ASTContext.cpp:12490: clang::QualType clang::ASTContext::getCorrespondingUnsignedType(clang::QualType) const: Assertion `(T->hasIntegerRepresentation() || T->isEnumeralType() || T->isFixedPointType()) && "Unexpected type"' 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 -target aarch64 <source>
1.	<source>:5:12: current parser token ';'
2.	<source>:3:18: parsing function body 'foo'
3.	<source>:3:18: in compound statement ('{}')
 #0 0x0000000004ee8888 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ee8888)
 #1 0x0000000004ee5ae4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ee5ae4)
 #2 0x0000000004ee611c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ee611c)
 #3 0x0000000004e203c8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x0000790d43245330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x0000790d4329ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #6 0x0000790d4324527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x0000790d432288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x0000790d4322881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x0000790d4323b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x0000000009fb0191 clang::ASTContext::getCorrespondingUnsignedType(clang::QualType) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x9fb0191)
#11 0x00000000094b8552 checkPointerTypesForAssignment(clang::Sema&, clang::QualType, clang::QualType, clang::SourceLocation) SemaExpr.cpp:0:0
#12 0x00000000094ca69f clang::Sema::CheckAssignmentConstraints(clang::QualType, clang::ActionResult<clang::Expr*, true>&, clang::CastKind&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x94ca69f)
#13 0x00000000094cb83d clang::Sema::CheckAssignmentConstraints(clang::SourceLocation, clang::QualType, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x94cb83d)
#14 0x00000000095efaee clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::ImplicitConversionSequence const&, clang::AssignmentAction, clang::CheckedConversionKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x95efaee)
#15 0x00000000098e6c68 clang::Sema::PerformImplicitConversion(clang::Expr*, clang::QualType, clang::AssignmentAction, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x98e6c68)
#16 0x000000000952d25f clang::Sema::CheckSingleAssignmentConstraints(clang::QualType, clang::ActionResult<clang::Expr*, true>&, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x952d25f)
#17 0x000000000952dd9c clang::Sema::CheckAssignmentOperands(clang::Expr*, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::QualType, clang::BinaryOperatorKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x952dd9c)
#18 0x000000000952f198 clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x952f198)
#19 0x00000000095309ba clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x95309ba)
#20 0x0000000009530f15 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x9530f15)
#21 0x0000000008fe73bc clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8fe73bc)
#22 0x0000000008feab49 clang::Parser::ParseExpression(clang::TypoCorrectionTypeBehavior) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8feab49)
#23 0x000000000907a718 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x907a718)
#24 0x0000000009071f9f 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+++0x9071f9f)
#25 0x0000000009072909 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x9072909)
#26 0x000000000907aec6 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x907aec6)
#27 0x000000000907b6aa clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x907b6aa)
#28 0x0000000008f733de clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f733de)
#29 0x0000000008fbe960 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+++0x8fbe960)
#30 0x0000000008f6729b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f6729b)
#31 0x0000000008f67a8f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f67a8f)
#32 0x0000000008f74708 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f74708)
#33 0x0000000008f75625 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f75625)
#34 0x0000000008f5191a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f5191a)
#35 0x00000000059ddd88 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59ddd88)
#36 0x0000000005d05568 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5d05568)
#37 0x0000000005c9210d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5c9210d)
#38 0x0000000005ddbb53 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5ddbb53)
#39 0x0000000001715fd8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1715fd8)
#40 0x000000000170ceba ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#41 0x000000000170d043 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
#42 0x0000000005a551e9 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
#43 0x0000000004e207c4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4e207c4)
#44 0x0000000005a55d55 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
#45 0x0000000005a134d2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a134d2)
#46 0x0000000005a1678c 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+++0x5a1678c)
#47 0x0000000005a228c5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5a228c5)
#48 0x000000000171260a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x171260a)
#49 0x0000000001687bf3 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1687bf3)
#50 0x0000790d4322a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#51 0x0000790d4322a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#52 0x000000000170c865 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x170c865)
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