[llvm-commits] [llvm] r113394 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Jim Grosbach
grosbach at apple.com
Wed Sep 8 12:55:28 PDT 2010
Author: grosbach
Date: Wed Sep 8 14:55:28 2010
New Revision: 113394
URL: http://llvm.org/viewvc/llvm-project?rev=113394&view=rev
Log:
Fix errant fall-throughs causing the base pointer to be used when the frame
pointer was intended. rdar://8401980
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=113394&r1=113393&r2=113394&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Sep 8 14:55:28 2010
@@ -1077,7 +1077,7 @@
// there are VLAs (and thus the SP isn't reliable as a base).
if (isFixed || (MFI->hasVarSizedObjects() && !hasBasePointer(MF))) {
FrameReg = getFrameRegister(MF);
- Offset = FPOffset;
+ return FPOffset;
} else if (MFI->hasVarSizedObjects()) {
assert(hasBasePointer(MF) && "missing base pointer!");
// Use the base register since we have it.
@@ -1087,12 +1087,12 @@
// out of range references.
if (FPOffset >= -255 && FPOffset < 0) {
FrameReg = getFrameRegister(MF);
- Offset = FPOffset;
+ return FPOffset;
}
} else if (Offset > (FPOffset < 0 ? -FPOffset : FPOffset)) {
// Otherwise, use SP or FP, whichever is closer to the stack slot.
FrameReg = getFrameRegister(MF);
- Offset = FPOffset;
+ return FPOffset;
}
}
// Use the base pointer if we have one.
More information about the llvm-commits
mailing list