[libunwind] [libunwind][Mips] Fix the o32 register save/restore code for MIPS I (PR #246542)

Alex Rønne Petersen via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 26 19:37:35 PST 2026


alexrp wrote:

By the way, this looks like a hazard to me:

https://github.com/llvm/llvm-project/blob/4febc8522d433e6cc622dc36025e5db070fff2b0/libunwind/src/UnwindRegistersRestore.S#L1145-L1151

Should probably be:

```asm
   // load new pc into ra
   lw    $31, (4 * 32)($4)
   // MIPS 1 has load delay slot. Ensure lw $31 and jr are separated by an instruction.
   lw    $30, (4 * 30)($4)
   // jump to ra
   lw    $4, (4 * 4)($4)
    jr    $31
     nop
```

https://github.com/llvm/llvm-project/pull/246542


More information about the cfe-commits mailing list