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 | 4642ca6589d3002861963744a157169f15d1ee90 (patch) | |
tree | d7b8436c1789723b149826e3bc43d6ffd6f5fbea /lib/Target/ARM/ARMRegisterInfo.cpp | |
parent | c1ec780d1eda06a1c753bd414df5af73fad0d66c (diff) |
bugfix: SP isn't resetted when function has FP and there is no spills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMRegisterInfo.cpp')
-rw-r--r-- | lib/Target/ARM/ARMRegisterInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMRegisterInfo.cpp b/lib/Target/ARM/ARMRegisterInfo.cpp index 961794681d..be4969a684 100644 --- a/lib/Target/ARM/ARMRegisterInfo.cpp +++ b/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); |