summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86RegisterInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-10-26 09:13:24 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-10-26 09:13:24 +0000
commitd07d6a411caafed14598eed9b50e189ae428aa0a (patch)
tree5f148b085362cbfe4f7442ec959d23f3141c62fc /llvm/lib/Target/X86/X86RegisterInfo.cpp
parent18063916b5eb81d11e4c36755ae447ecd710fdc1 (diff)
downloadbcm5719-llvm-d07d6a411caafed14598eed9b50e189ae428aa0a.tar.gz
bcm5719-llvm-d07d6a411caafed14598eed9b50e189ae428aa0a.zip
Fix off-by-one stack offset computations (dwarf information) for callee-saved
registers in case, when FP pointer was eliminated. This should fixes misc. random EH-related crahses, when stuff is compiled with -fomit-frame-pointer. Thanks Duncan for nailing this bug! llvm-svn: 43381
Diffstat (limited to 'llvm/lib/Target/X86/X86RegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 72e0fe44b30..a7b98b528ce 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -1816,10 +1816,11 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
MFI->getObjectOffset(CSI[I].getFrameIdx()));
// Calculate offsets
+ int64_t saveAreaOffset = (hasFP(MF) ? 3 : 2)*stackGrowth;
for (unsigned I = 0, E = CSI.size(); I!=E; ++I) {
int64_t Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
unsigned Reg = CSI[I].getReg();
- Offset = (MaxOffset-Offset+3*stackGrowth);
+ Offset = (MaxOffset-Offset+saveAreaOffset);
MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
MachineLocation CSSrc(Reg);
Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
OpenPOWER on IntegriCloud