1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

bugfix: SP isn't resetted when function has FP and there is no spills.

llvm-svn: 33800
This commit is contained in:
Lauro Ramos Venancio 2007-02-02 23:08:40 +00:00
parent d3fb549bdc
commit 1b8a04e036

View File

@ -1140,10 +1140,11 @@ void ARMRegisterInfo::emitEpilogue(MachineFunction &MF,
if (STI.isTargetDarwin() || hasFP(MF)) {
NumBytes = AFI->getFramePtrSpillOffset() - NumBytes;
// Reset SP based on frame pointer only if the stack frame extends beyond
// frame pointer stack slot.
// frame pointer stack slot or target is ELF and the function has FP.
if (AFI->getGPRCalleeSavedArea2Size() ||
AFI->getDPRCalleeSavedAreaSize() ||
AFI->getDPRCalleeSavedAreaOffset())
AFI->getDPRCalleeSavedAreaOffset()||
hasFP(MF))
if (NumBytes)
BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr)
.addImm(NumBytes);