<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63608>63608</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Segmentation fault in MIPS SelectionDAG
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Nilstrieb
</td>
</tr>
</table>
<pre>
This been causing lots of spurious failures in Rust's CI recently, see https://github.com/rust-lang/rust/issues/113065
```llvm
; ModuleID = 'reduced.bc'
target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
target triple = "mips64-unknown-linux-gnuabi64"
define internal fastcc void @uwu(<5 x i32> %self.8.val) {
start:
store <5 x i32> %self.8.val, ptr null, align 4
ret void
}
```
`llc code.ll`
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc reduced.ll
1. Running pass 'Function Pass Manager' on module 'reduced.ll'.
2. Running pass 'MIPS DAG->DAG Pattern Instruction Selection' on function '@uwu'
#0 0x00007fead70ba06e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x10ba06e)
#1 0x00007fead70b78eb SignalHandler(int) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x10b78eb)
#2 0x00007fead5a52d60 __restore_rt (/nix/store/dg8mpqqykmw9c7l0bgzzb5znkymlbfjw-glibc-2.37-8/lib/libc.so.6+0x38d60)
#3 0x00007fead7b058b2 llvm::SelectionDAG::createOperands(llvm::SDNode*, llvm::ArrayRef<llvm::SDValue>) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b058b2)
#4 0x00007fead7b2332d llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc const&, llvm::EVT, llvm::ArrayRef<llvm::SDValue>, llvm::SDNodeFlags) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b2332d)
#5 0x00007fead7b386c9 llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc const&, llvm::EVT, llvm::ArrayRef<llvm::SDUse>) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b386c9)
#6 0x00007fead796b7ec (anonymous namespace)::DAGCombiner::visitEXTRACT_SUBVECTOR(llvm::SDNode*) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x196b7ec)
#7 0x00007fead7977a5d (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1977a5d)
#8 0x00007fead797914f llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x197914f)
#9 0x00007fead7b52771 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b52771)
#10 0x00007fead7b5550f llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b5550f)
#11 0x00007fead7b57cd5 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1b57cd5)
#12 0x00007feada38553a llvm::MipsDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x438553a)
#13 0x00007fead7564171 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x1564171)
#14 0x00007fead723b530 llvm::FPPassManager::runOnFunction(llvm::Function&) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x123b530)
#15 0x00007fead723b65c llvm::FPPassManager::runOnModule(llvm::Module&) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x123b65c)
#16 0x00007fead723bfdd llvm::legacy::PassManagerImpl::run(llvm::Module&) (/nix/store/33zbbqa7n6qfbliy77d4c53fcvd2bym9-llvm-16.0.1-lib/lib/libLLVM-16.so+0x123bfdd)
#17 0x0000000000411a33 main (/nix/store/l39q5l25yclps25kdwim670mmviiaa6i-llvm-16.0.1/bin/llc+0x411a33)
#18 0x00007fead5a3dace __libc_start_call_main (/nix/store/dg8mpqqykmw9c7l0bgzzb5znkymlbfjw-glibc-2.37-8/lib/libc.so.6+0x23ace)
#19 0x00007fead5a3db89 __libc_start_main@GLIBC_2.2.5 (/nix/store/dg8mpqqykmw9c7l0bgzzb5znkymlbfjw-glibc-2.37-8/lib/libc.so.6+0x23b89)
#20 0x0000000000412215 _start (/nix/store/l39q5l25yclps25kdwim670mmviiaa6i-llvm-16.0.1/bin/llc+0x412215)
fish: Job 1, 'llc reduced.ll' terminated by signal SIGSEGV (Address boundary error)
```
the issue was originally discovered and reproduced on x86-64 ubuntu 20 on LLVM 22897bce7bfedc9cd3953a33419b346936263500, I've done the reduction on NixOS using its `llvmPackages_16` package.
</pre>
<img width="1px"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