RISC-V 64 NCG: allocMoreStack probably deallocates too little and too much
Summary
The RISC-V NCG probably suffers from a similar issue as #25733 (closed) .
According to Note [extra spill slots]
we have to emit deallocation instructions for non-local jumps. And, not for local jumps.
Currently, the code generator does the opposite:
- It generates deallocation instructions for jump tables (
J_TBL
) which are local jumps. - It does not generate deallocation instructions for non-local jumps. In fact, we don't even distinguish between local and non-local jumps in the
Instr
instruction set.
Steps to reproduce
Unfortunately, the reproducer of #25733 (closed) does not hit
Expected behavior
- Don't emit deallocation instructions for
J_TBL
. - Emit them for (to be introduced) non-local jumls (e.g.
J
).
- System Architecture: RISC-V 64 (NCG)