<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/155072>155072</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ICE on _BitInt with -fenable-matrix
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Eczbek
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/9bGTx68x9
```c
void f() {
_BitInt(2) x = 0; // crash when size < 8
__builtin_matrix_column_major_store(x * __builtin_matrix_column_major_load(&x, 1, 1, 1), &x, 1);
}
int main() {}
```
```
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-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 -fenable-matrix <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
#0 0x0000000003d05bb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3d05bb8)
#1 0x0000000003d0358c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3d0358c)
#2 0x0000000003c53798 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007a3fc4442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x0000000005260fba llvm::SelectionDAG::isConstantIntBuildVectorOrConstantInt(llvm::SDValue, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x5260fba)
#5 0x000000000526119b llvm::SelectionDAG::canonicalizeCommutativeBinop(unsigned int, llvm::SDValue&, llvm::SDValue&) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x526119b)
#6 0x000000000527c34f llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc const&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags) (/opt/compiler-explorer/clang-trunk/bin/clang+0x527c34f)
#7 0x00000000054194fe llvm::DAGTypeLegalizer::PromoteIntRes_SimpleIntBinOp(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x54194fe)
#8 0x0000000005433f8b llvm::DAGTypeLegalizer::PromoteIntegerResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5433f8b)
#9 0x000000000535175a llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-trunk/bin/clang+0x535175a)
#10 0x0000000005351da1 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-trunk/bin/clang+0x5351da1)
#11 0x00000000052bf142 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/clang+0x52bf142)
#12 0x00000000052c1c4d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x52c1c4d)
#13 0x00000000052c3aa6 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x52c3aa6)
#14 0x00000000052b1241 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x52b1241)
#15 0x00000000030d2d0d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x30d2d0d)
#16 0x00000000036478a2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x36478a2)
#17 0x0000000003647b31 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3647b31)
#18 0x0000000003649479 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3649479)
#19 0x0000000003faa6cd clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3faa6cd)
#20 0x000000000462dc4c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x462dc4c)
#21 0x00000000062b96cc clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62b96cc)
#22 0x000000000462e43d clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x462e43d)
#23 0x000000000493a7fa clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x493a7fa)
#24 0x00000000048b3b3b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x48b3b3b)
#25 0x0000000004a2bcb3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a2bcb3)
#26 0x0000000000dc28b5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xdc28b5)
#27 0x0000000000dba85d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x00000000046a0b19 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
#29 0x0000000003c53bb3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3c53bb3)
#30 0x00000000046a0d39 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
#31 0x0000000004663cbd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x4663cbd)
#32 0x0000000004664c71 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x4664c71)
#33 0x000000000466ed0c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x466ed0c)
#34 0x0000000000dbf0c1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xdbf0c1)
#35 0x0000000000c6de14 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xc6de14)
#36 0x00007a3fc4429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#37 0x00007a3fc4429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#38 0x0000000000dba2f5 _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xdba2f5)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkmsty2zjWgJ-G3qCkIgGKIhde0LKV313pPy7L0zU7FQgeymiDAAcAFTlPPwWSEi--JWN1z2JSSSTh-p0LcA5AUmP4TgJceosrb3F9QWv7qPTlDfuRwdNFpvLny0drK-OR1MNrD693Ks-UsHOldx5e__DwOsm-PByi-JB4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