crash: LLVM ERROR: Found 3 machine code errors.

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:LLVM ERROR: Found 3 machine code errors.
Occurrences:3 in 3 configs, 1 test files, 4 more counted only
Snippet from:qci-interrupt-zilsd.ll @test_nest_empty via llvm-extract
Config:-mtriple=riscv32 -mattr=+xqciint,+zilsd -verify-machineinstrs
Local check:reproduces at d9924131a4
Compiler Explorer:https://godbolt.org/z/raKqEr96b (llc-assertions-trunk, checked 2026-11-27 11:50 UTC): G reproduces

Snippet:

define void @test_nest_empty() #0 {
  ret void
}

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

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv32 -mattr=+xqciint,+zilsd -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340
# After Prologue/Epilogue Insertion & Frame Finalization
# Machine code for function test_nest_empty: NoPHIs, TracksLiveness, NoVRegs, Legalized, RegBankSelected, Selected, TiedOpsRewritten, TracksDebugUserValues
SelectionDAG (control)-mtriple=riscv32 -mattr=+xqciint,+zilsd -verify-machineinstrs -global-isel=0018-

Reproduce:

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

Local llc output:

# After Prologue/Epilogue Insertion & Frame Finalization
# Machine code for function test_nest_empty: NoPHIs, TracksLiveness, NoVRegs, Legalized, RegBankSelected, Selected, TiedOpsRewritten, TracksDebugUserValues
bb.0 (%ir-block.0):
  $x2 = frame-setup ADDI $x2, -96
  frame-setup CFI_INSTRUCTION def_cfa_offset 96
  PseudoRET
  frame-setup CFI_INSTRUCTION def_cfa_offset 96
  $x2 = frame-destroy ADDI $x2, 96
  frame-destroy CFI_INSTRUCTION def_cfa_offset 0
# End machine code for function test_nest_empty.
*** Bad machine code: Non-terminator instruction after the first terminator ***
- function:    test_nest_empty
- basic block: %bb.0  (0x55a21d2e8ef0)
- instruction: frame-setup CFI_INSTRUCTION def_cfa_offset 96
First terminator was:	PseudoRET
*** Bad machine code: Non-terminator instruction after the first terminator ***
- function:    test_nest_empty
- basic block: %bb.0  (0x55a21d2e8ef0)
- instruction: $x2 = frame-destroy ADDI $x2, 96
First terminator was:	PseudoRET
*** Bad machine code: Non-terminator instruction after the first terminator ***
- function:    test_nest_empty
- basic block: %bb.0  (0x55a21d2e8ef0)
- instruction: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
First terminator was:	PseudoRET
LLVM ERROR: Found 3 machine code errors.
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 -mattr=+xqciint,+zilsd -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Verify generated machine code' on function '@test_nest_empty'
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       0x000055a1fc9d4b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055a1fc9d1b31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055a1fc9d55db
3  libc.so.6 0x00007fdd49c45330
4  libc.so.6 0x00007fdd49c9ebec pthread_kill + 284
5  libc.so.6 0x00007fdd49c4527e gsignal + 30
6  libc.so.6 0x00007fdd49c288ff abort + 223
7  llc       0x000055a1fc92cf6d llvm::report_fatal_error(llvm::Twine const&, bool) + 429
8  llc       0x000055a1fb78f713
9  llc       0x000055a1fb790873
10 llc       0x000055a1fb64d891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
11 llc       0x000055a1fbbe97f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
12 llc       0x000055a1fbbf1d12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
13 llc       0x000055a1fbbea5a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
14 llc       0x000055a1fae448c9
15 llc       0x000055a1fae41a53 main + 1747
16 libc.so.6 0x00007fdd49c2a1ca
17 libc.so.6 0x00007fdd49c2a28b __libc_start_main + 139
18 llc       0x000055a1fae40b65 _start + 37

Occurrences (3):

InputFunctionConfig
qci-interrupt-zilsd.ll-mtriple=riscv32 -mattr=+xqciint,+zilsd -verify-machineinstrs
qci-interrupt-zilsd.ll-mtriple=riscv32 -mattr=+xqciint,+zilsd,+zclsd,+c -verify-machineinstrs
qci-interrupt-zilsd.9730965a0d.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2

Generated 2026-11-29 14:49 UTC.