crash: Assertion failed: (MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"), function restoreCalleeSavedRegisters, file RISCVFrameLowering.cpp

Run:explore-b577f07195-20261129-105236
Kind:crash
Category:Assertion failed: (MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"), function restoreCalleeSavedRegisters, file RISCVFrameLowering.cpp M
Occurrences:3 in 3 configs, 1 test files, 116 more counted only
Snippet from:qci-interrupt-zilsd.9b34c3bf04.ll (mutant of qci-interrupt-zilsd.ll) @test_nest_clobber_s1 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1
Local check:reproduces at b577f07195
Compiler Explorer:https://godbolt.org/z/PjEosj7eW (llc-assertions-trunk, checked 2026-11-29 14:48 UTC): G reproduces

Snippet:

define void @test_nest_clobber_s1() #0 {
  %A = alloca i32, align 4
  store i32 poison, ptr %A, align 4
  call void asm sideeffect "", "~{s1}"()
  %B = srem i32 0, 0
  store i32 %B, ptr %A, align 4
  ret void
}

attributes #0 = { "interrupt"="qci-nest" }

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340llc: /root/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:2928: virtual bool llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, llvm::MutableArrayRef<llvm::CalleeSavedInfo>, const llvm::TargetRegisterInfo*) const: Assertion `MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
SelectionDAG (control)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1 -global-isel=006-

Reproduce:

llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1 -global-isel=0 snippet.ll -o -

Local llc output:

llc: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:2929: virtual bool llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &, MachineBasicBlock::iterator, MutableArrayRef<CalleeSavedInfo>, const TargetRegisterInfo *) const: Assertion `MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/build/bin/llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@test_nest_clobber_s1'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llc       0x000055679e3699eb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055679e3669c1 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055679e36a46b
3  libc.so.6 0x00007efebd245330
4  libc.so.6 0x00007efebd29ebec pthread_kill + 284
5  libc.so.6 0x00007efebd24527e gsignal + 30
6  libc.so.6 0x00007efebd2288ff abort + 223
7  libc.so.6 0x00007efebd22881b
8  libc.so.6 0x00007efebd23b517
9  llc       0x000055679c8473ad
10 llc       0x000055679d1dc6b4
11 llc       0x000055679d1e1597
12 llc       0x000055679cfe36b1 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
13 llc       0x000055679d57eb37 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
14 llc       0x000055679d587052 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
15 llc       0x000055679d57f8e0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
16 llc       0x000055679c7da149
17 llc       0x000055679c7d72d3 main + 1747
18 libc.so.6 0x00007efebd22a1ca
19 libc.so.6 0x00007efebd22a28b __libc_start_main + 139
20 llc       0x000055679c7d63e5 _start + 37

Occurrences (3):

InputFunctionConfig
qci-interrupt-zilsd.04393095a1.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zicsr,+zicond -O2
qci-interrupt-zilsd.9b34c3bf04.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c,+zihintpause -O1
qci-interrupt-zilsd.c6e2917d92.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+d -O0

Generated 2026-11-29 14:49 UTC.