<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108326>108326</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Assertion trunk crashes at tryVectorConvertAndSplat(clang::Sema&, clang::ActionResult<clang::Expr*, true>*, clang::QualType, clang::QualType, clang::QualType, unsigned int&)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yijan4845
</td>
</tr>
</table>
<pre>
Compiler Explorer: [https://godbolt.org/z/EW9bxMose](https://godbolt.org/z/EW9bxMose)
Attempting to compile below program with Clang Assertion Trunk:
```c
typedef _Bool bool4 __attribute__((ext_vector_type(4)));
int main( ) {
bool4 x = 0;
x != 0;
}
```
Stack dump:
```
clang: /root/llvm-project/clang/lib/AST/Expr.cpp:1928: bool clang::CastExpr::CastConsistency() const: Assertion `!getType()->isBooleanType() && "unheralded conversion to bool"' 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 -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <source>:5:11: current parser token ';'
2. <source>:3:13: parsing function body 'main'
3. <source>:3:13: in compound statement ('{}')
#0 0x0000000003b2e8d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b2e8d8)
#1 0x0000000003b2c59c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b2c59c)
#2 0x0000000003a7ace8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000073b511842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000073b5118969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000073b511842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000073b5118287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000073b51182871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000073b511839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00000000079e84f0 clang::CastExpr::CastConsistency() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x79e84f0)
#10 0x00000000079e933f clang::ImplicitCastExpr::Create(clang::ASTContext const&, clang::QualType, clang::CastKind, clang::Expr*, llvm::SmallVector<clang::CXXBaseSpecifier*, 4u> const*, clang::ExprValueKind, clang::FPOptionsOverride) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x79e933f)
#11 0x000000000675dd21 clang::Sema::ImpCastExprToType(clang::Expr*, clang::QualType, clang::CastKind, clang::ExprValueKind, llvm::SmallVector<clang::CXXBaseSpecifier*, 4u> const*, clang::CheckedConversionKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x675dd21)
#12 0x0000000006b1ec88 tryVectorConvertAndSplat(clang::Sema&, clang::ActionResult<clang::Expr*, true>*, clang::QualType, clang::QualType, clang::QualType, unsigned int&) SemaExpr.cpp:0:0
#13 0x0000000006bbc1c0 clang::Sema::CheckVectorOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bbc1c0)
#14 0x0000000006bbc40f clang::Sema::CheckVectorCompareOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::BinaryOperatorKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bbc40f)
#15 0x0000000006bc57bf clang::Sema::CheckCompareOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::BinaryOperatorKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bc57bf)
#16 0x0000000006bcdb75 clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bcdb75)
#17 0x0000000006bcf2dd clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bcf2dd)
#18 0x0000000006bcfab1 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6bcfab1)
#19 0x000000000664e807 clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x664e807)
#20 0x00000000066519c9 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66519c9)
#21 0x00000000066d2ff9 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66d2ff9)
#22 0x00000000066c9ae0 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+0x66c9ae0)
#23 0x00000000066caa10 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66caa10)
#24 0x00000000066cb8e9 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66cb8e9)
#25 0x00000000066cd06a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66cd06a)
#26 0x00000000065e0f93 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65e0f93)
#27 0x000000000661661d 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+0x661661d)
#28 0x00000000065d4c4e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65d4c4e)
#29 0x00000000065d53fe clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65d53fe)
#30 0x00000000065db987 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65db987)
#31 0x00000000065dc85d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65dc85d)
#32 0x00000000065cfe4a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x65cfe4a)
#33 0x000000000447ab58 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x447ab58)
#34 0x000000000470c0b9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x470c0b9)
#35 0x000000000468f96e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x468f96e)
#36 0x00000000047f52be clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f52be)
#37 0x0000000000cbcb7f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xcbcb7f)
#38 0x0000000000cb5dca ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#39 0x00000000044bdfb9 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 0x0000000003a7b194 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3a7b194)
#41 0x00000000044be5af 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 0x00000000044844b5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44844b5)
#43 0x0000000004484f1d 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+0x4484f1d)
#44 0x000000000448cb65 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x448cb65)
#45 0x0000000000cb9f75 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xcb9f75)
#46 0x0000000000b8bc84 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xb8bc84)
#47 0x000073b511829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#48 0x000073b511829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#49 0x0000000000cb587e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xcb587e)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW01z4zbS_jX0BSUXCX4ffJBlK5m8k_K8I1c2NxUINmXGFMAFQI-8v34LACUTtKSxZzjZze6mHA8NAo2nn240Gh8kUtYbBnDlxddefHNBOvXAxdVz_QdhURbFFwUvn68WfNvWDQh0u2sbLkB44Rx58fWDUq30wrmHlx5ebnhZ8EZdcrHx8PIfHl7e_i0vdr9yCV584-Hs7dVx7vk3nj-3v-dKwbZVNdsgxRG1YFABDf-CWsE3gmzRl1o9oEVD2AbNpQShas7QvejYo-7QCkt8-0Pt3-q5hRIqtL7mvEEF502E1muilKiLTsF67eHMwxns1PoJqOJirVt4OIs0PvsTXg-B1kyhLamZhzPk4Rx5af8aIdR3sENeeIP8Q0P9Zoc8HLjFXnozAj3sZ6UIfURlt21fK2f_pJoJYyW8FJwrDy-b5mk7awX_A6j-09bAy6YuPLycr-61AXatuKStlhrkONPtNWq0l-aF8wWRSld7-WvBmaylAkafDWE5opxJpRu_WEIDw8EG1L2l0MP5zAtva6m5B8JeipGHEw8nyMO4Yw8gSFNCqUU-gZBalOIGlIexh1NUkbqB8tJq_enj7Xx1i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