diff options
author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-02-02 23:08:40 +0000 |
---|---|---|
committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-02-02 23:08:40 +0000 |
commit | b739f7d3376ea343b80c936e50e9dd54f1ce264a (patch) | |
tree | 333881e8d096c6b70d29b9d3b841f7a98ae2fc36 /llvm/lib/Target/ARM/ARMRegisterInfo.cpp | |
parent | fc8190dbb76b6ec90f96537fd255fc4e9b518b79 (diff) | |
download | bcm5719-llvm-b739f7d3376ea343b80c936e50e9dd54f1ce264a.tar.gz bcm5719-llvm-b739f7d3376ea343b80c936e50e9dd54f1ce264a.zip |
bugfix: SP isn't resetted when function has FP and there is no spills.
llvm-svn: 33800
Diffstat (limited to 'llvm/lib/Target/ARM/ARMRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMRegisterInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMRegisterInfo.cpp index 961794681da..be4969a6842 100644 --- a/llvm/lib/Target/ARM/ARMRegisterInfo.cpp +++ b/llvm/lib/Target/ARM/ARMRegisterInfo.cpp @@ -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); |