Make sure offset is 0 for load/store register to the stack call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116640 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2010-10-15 23:07:10 +00:00
parent 6549121c66
commit c9a91fdaf9

View File

@ -762,7 +762,7 @@ bool ARMFastISel::ARMEmitLoad(EVT VT, unsigned &ResultReg,
assert((Base.Reg == ARM::SP || Offset == 0) &&
"Offset not zero and not a stack load!");
if (Base.Reg == ARM::SP)
if (Base.Reg == ARM::SP && Offset == 0)
TII.loadRegFromStackSlot(*FuncInfo.MBB, *FuncInfo.InsertPt,
ResultReg, Base.FrameIndex, RC,
TM.getRegisterInfo());
@ -832,7 +832,7 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg,
break;
}
if (Base.Reg == ARM::SP)
if (Base.Reg == ARM::SP && Offset == 0)
TII.storeRegToStackSlot(*FuncInfo.MBB, *FuncInfo.InsertPt,
SrcReg, true /*isKill*/, Base.FrameIndex,
TLI.getRegClassFor(VT), TM.getRegisterInfo());