Issue |
130470
|
Summary |
Assertion `vecType->isBuiltinType() || vecType->isDependentType() || (vecType->isBitIntType() && llvm::isPowerOf2_32(vecType->castAs<BitIntType>()->getNumBits()) && vecType->castAs<BitIntType>()->getNumBits() >= 8)' failed.
|
Labels |
new issue
|
Assignees |
|
Reporter |
bi6c
|
Compiler Explorer: https://godbolt.org/z/sd691xMKo
testcase is generated by fuzzer
```console
<source>:5:64: warning: '_BitInt' suffix for literals is a C23 extension [-Wc23-extensions]
5 | uv1ti rotr(uv1ti x, unsigned int i) { return (x >> i) | (x << (66666666666666666666wb - i)); }
| ^
clang: /root/llvm-project/clang/lib/AST/ASTContext.cpp:4587: clang::QualType clang::ASTContext::getExtVectorType(clang::QualType, unsigned int) const: Assertion `vecType->isBuiltinType() || vecType->isDependentType() || (vecType->isBitIntType() && llvm::isPowerOf2_32(vecType->castAs<BitIntType>()->getNumBits()) && vecType->castAs<BitIntType>()->getNumBits() >= 8)' failed.
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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -c --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <source>:5:91: current parser token ')'
2. <source>:5:37: parsing function body 'rotr'
3. <source>:5:37: in compound statement ('{}')
#0 0x0000000003e6bf88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e6bf88)
#1 0x0000000003e69c44 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e69c44)
#2 0x0000000003db6558 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007fd583442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007fd5834969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007fd583442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007fd5834287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007fd58342871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007fd583439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x0000000007319057 clang::ASTContext::getExtVectorType(clang::QualType, unsigned int) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x7319057)
#10 0x0000000006951f71 checkVectorShift(clang::Sema&, clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, bool) SemaExpr.cpp:0:0
#11 0x0000000006960311 clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6960311)
#12 0x000000000696193d clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x696193d)
#13 0x0000000006962154 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6962154)
#14 0x00000000064a415d clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a415d)
#15 0x00000000064a77e9 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a77e9)
#16 0x00000000064abb1d clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool, bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64abb1d)
#17 0x00000000064a1a61 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a1a61)
#18 0x00000000064a2d17 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a2d17)
#19 0x00000000064a4047 clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a4047)
#20 0x00000000064a77e9 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64a77e9)
#21 0x000000000651dea2 clang::Parser::ParseReturnStatement() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x651dea2)
#22 0x00000000065210a5 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65210a5)
#23 0x00000000065227d0 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65227d0)
#24 0x00000000065236c1 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65236c1)
#25 0x0000000006524eaa clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6524eaa)
#26 0x00000000064366d3 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64366d3)
#27 0x000000000646b48d 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+0x646b48d)
#28 0x000000000642a40e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x642a40e)
#29 0x000000000642abc9 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x642abc9)
#30 0x00000000064323a3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64323a3)
#31 0x000000000643327d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x643327d)
#32 0x000000000642570a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x642570a)
#33 0x000000000482f988 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x482f988)
#34 0x0000000004af82c5 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4af82c5)
#35 0x0000000004a7ba9e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4a7ba9e)
#36 0x0000000004be6f8e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4be6f8e)
#37 0x0000000000d52c87 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd52c87)
#38 0x0000000000d49a4a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#39 0x0000000004877d89 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 0x0000000003db6a04 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3db6a04)
#41 0x000000000487837f 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 0x000000000483ab5d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x483ab5d)
#43 0x000000000483bbde 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+0x483bbde)
#44 0x0000000004843af5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4843af5)
#45 0x0000000000d4ef23 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd4ef23)
#46 0x0000000000c16b04 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc16b04)
#47 0x00007fd583429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#48 0x00007fd583429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#49 0x0000000000d494f5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd494f5)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
Code:
```c
typedef unsigned __int128 uv1ti __attribute__((__vector_size__(16)));
typedef __int128 sv1ti __attribute__((__vector_size__(16)));
uv1ti rotr(uv1ti x, unsigned int i) { return (x >> i) | (x << (66666666666666666666wb - i)); }
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs