[PATCH] [PowerPC] Fix unwind info with dynamic stack realignment
hfinkel at anl.gov
hfinkel at anl.gov
Thu Nov 27 18:14:48 PST 2014
Thanks for working on this. I know very little about the CFI directives, and so I'm afraid this might not be the end of the story; specifically, I'm worried about the meaning of the offsets used for the other registers.
When we have a stack pointer or a frame pointer, these store the values of those registers after being adjusted for the local stack size. When we use a base pointer, the base pointer hold the pre-adjusted r1 value. So in PPCRegisterInfo::eliminateFrameIndex we have this:
if (!MF.getFunction()->getAttributes().
hasAttribute(AttributeSet::FunctionIndex, Attribute::Naked)) {
if (!(hasBasePointer(MF) && FrameIndex < 0))
Offset += MFI->getStackSize();
}
because to access parent-frame relative objects using the stack/frame pointer we need to add back the local stack size, but if we're using a base pointer, we don't. Maybe this is all fine, but using the same offsets when calling MCCFIInstruction::createOffset for the sp/fp and the bp seems suspicious. Can you please confirm that the offsets are indeed correct in all cases, and regardless, please add some comments explaining your conclusion.
http://reviews.llvm.org/D6410
More information about the llvm-commits
mailing list