[PATCH] [PowerPC] Fix unwind info with dynamic stack realignment

Ulrich Weigand ulrich.weigand at de.ibm.com
Fri Nov 28 04:22:42 PST 2014


>>! In D6410#10, @foad wrote:
> Incidentally, is there any need to have accurate unwind info *before* we copy SP to FP? If not, we could do it all after the copy to FP, simplifying the code a bit and probably saving the odd byte in the CFI encoding:
> ```
>   if (HasBP)
>     .cfi_def_cfa_register BP
>   else if (HasFP)
>     .cfi_def_cfa FP, NegFrameSize
>   else
>     .cfi_def_cfa_offset NegFrameSize
> ```

Yes, we should have accurate unwind info at any position in the function, so that debugging / stack backtraces etc. work correctly.  This means we need to define CFA in terms of SP first, and then switch to a definition in terms of FP/BP as soon as the original definition becomes invalid due to code changing SP.

http://reviews.llvm.org/D6410






More information about the llvm-commits mailing list