On 5/20/24 5:32 PM, Vineet Gupta wrote:
This is testsuite clean however there's a dwarf quirk which I want to
run by the experts. The test that was tripping CI has following
fragment:

        Before patch            |       After Patch
------------------------------------------------------
    li  t0,-4096                |  addi sp,s0,-2048
    addi        t0,t0,560               |  .cfi_def_cfa 2, 2048      <- #1
    add sp,s0,t0                |  addi sp,sp,-1488
    .cfi_def_cfa 2, 3536                |  .cfi_def_cfa_offset 3536  <- #2
    addi        sp,sp,1504              |  addi sp,sp,1504
    .cfi_def_cfa_offset 2032    |  .cfi_def_cfa_offset 2032  <- #3

The dwarf insn #1 and #3 seem ok, however #2 seems dubious to me.
What about it seems dubious? We need a CFA adjustment on each insn that modifies the stack pointer so that we can unwind at any arbitrary point.

The first adjustment says the prior frame is at sp + 2048. Then it's at sp + 3536. Then after the final insn the prior frame is at sp+2032.

Jeff

Reply via email to