mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 18:24:05 +00:00
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
This commit is contained in:
parent
82c77dd85b
commit
0d3f43480e
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user