On 5/20/24 20:54, Jeff Law wrote: > 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?
My discomfort at claiming I understand dwarf, despite debugging/fixing the ARC Linux port's in kernel dwarf unwinder :-) > We need a CFA adjustment on each insn that > modifies the stack pointer so that we can unwind at any arbitrary point. Of course. > 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. Yeah I got confused with second one since once it gets anchored to SP from S0, but you are right it is farther from base CFA now. -Vineet