Issue 234170
Summary [clang][AArch64][SVE] Assertion `Ty->isSveVLSBuiltinType() && "Invalid SVE Type"' failed.
Labels backend:AArch64, clang:frontend, crash-on-invalid, SVE, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/bvzbs1q7j
```cpp
using ullv16 = unsigned long long __attribute__((vector_size(16)));

__clang_svint8x4_t foo(ullv16 p) { return p; }
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/Sema/SemaARM.cpp:1701: uint64_t clang::getSVETypeSize(clang::ASTContext&, const clang::BuiltinType*, bool): Assertion `Ty->isSveVLSBuiltinType() && "Invalid SVE 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>:3:44: current parser token ';'
2.	<source>:3:34: parsing function body 'foo'
3.	<source>:3:34: in compound statement ('{}')
 #0 0x000000000451a928 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x451a928)
 #1 0x0000000004517b84 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4517b84)
 #2 0x00000000045181bc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45181bc)
 #3 0x0000000004451b68 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x000077689b445330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x000077689b49ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #6 0x000077689b44527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x000077689b4288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x000077689b42881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x000077689b43b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x000000000704dcb4 clang::getSVETypeSize(clang::ASTContext&, clang::BuiltinType const*, bool) SemaARM.cpp:0:0
#11 0x000000000704eca1 clang::SemaARM::areCompatibleSveTypes(clang::QualType, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x704eca1)
#12 0x00000000077f84d5 IsStandardConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::StandardConversionSequence&, bool, bool) SemaOverload.cpp:0:0
#13 0x00000000077f8e3d TryImplicitConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) SemaOverload.cpp:0:0
#14 0x00000000078099c2 clang::Sema::TryImplicitConversion(clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x78099c2)
#15 0x00000000075ab7a9 clang::InitializationSequence::InitializeFrom(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x75ab7a9)
#16 0x00000000075b6547 clang::Sema::PerformCopyInitialization(clang::InitializedEntity const&, clang::SourceLocation, clang::ActionResult<clang::Expr*, true>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x75b6547)
#17 0x0000000007842d74 clang::Sema::PerformMoveOrCopyInitialization(clang::InitializedEntity const&, clang::Sema::NamedReturnInfo const&, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7842d74)
#18 0x000000000785b5c0 clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x785b5c0)
#19 0x000000000785c2a7 clang::Sema::ActOnReturnStmt(clang::SourceLocation, clang::Expr*, clang::Scope*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x785c2a7)
#20 0x0000000006f8fff5 clang::Parser::ParseReturnStatement() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6f8fff5)
#21 0x0000000006f94c7d 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+++0x6f94c7d)
#22 0x0000000006f95e26 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6f95e26)
#23 0x0000000006f9e376 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6f9e376)
#24 0x0000000006f9eb5a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6f9eb5a)
#25 0x0000000006e98c6e clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e98c6e)
#26 0x0000000006ee43e0 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+++0x6ee43e0)
#27 0x0000000006e8cb2b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e8cb2b)
#28 0x0000000006e8d31f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e8d31f)
#29 0x0000000006e99f98 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e99f98)
#30 0x0000000006e9aeb5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e9aeb5)
#31 0x0000000006e7716a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e7716a)
#32 0x0000000005008b98 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5008b98)
#33 0x000000000532d0c8 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x532d0c8)
#34 0x00000000052b9e3d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52b9e3d)
#35 0x0000000005402ce3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5402ce3)
#36 0x0000000000d71a28 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd71a28)
#37 0x0000000000d688aa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#38 0x0000000000d68a33 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
#39 0x000000000507f6e9 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
#40 0x0000000004451f64 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4451f64)
#41 0x0000000005080255 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
#42 0x000000000503e272 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x503e272)
#43 0x0000000005042b87 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+++0x5042b87)
#44 0x000000000504d035 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x504d035)
#45 0x0000000000d6dffa clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd6dffa)
#46 0x0000000000cda1b3 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcda1b3)
#47 0x000077689b42a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#48 0x000077689b42a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#49 0x0000000000d68255 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd68255)
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