From 6e9422e14c816ab6cdc691989bb7d42a19b28fa3 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Mon, 12 Nov 2001 23:26:35 +0000 Subject: When allocating space on stack for writing a register, use the size of the register, not the size of the Value type, to get the right alignment. llvm-svn: 1284 --- llvm/lib/Target/Sparc/SparcRegInfo.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/Sparc/SparcRegInfo.cpp') diff --git a/llvm/lib/Target/Sparc/SparcRegInfo.cpp b/llvm/lib/Target/Sparc/SparcRegInfo.cpp index 16e3b9f0380..e59a3ab2b41 100644 --- a/llvm/lib/Target/Sparc/SparcRegInfo.cpp +++ b/llvm/lib/Target/Sparc/SparcRegInfo.cpp @@ -709,9 +709,9 @@ void UltraSparcRegInfo::colorCallArgs(const MachineInstr *const CallMI, int TReg = PRA.getRegNotUsedByThisInst( LR->getRegClass(), CallMI ); - int TmpOff = PRA.mcInfo.pushTempValue(target, - target.findOptimalStorageSize(LR->getType())); - // getStackOffsets().getNewTmpPosOffFromFP(); + /**** NOTE: THIS SHOULD USE THE RIGHT SIZE FOR THE REG BEING PUSHED ****/ + int TmpOff = PRA.mcInfo.pushTempValue(target, 8); + // target.findOptimalStorageSize(LR->getType())); int argOffset = PRA.mcInfo.allocateOptionalArg(target, LR->getType()); @@ -1174,8 +1174,9 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst, // and add them to InstrnsBefore and InstrnsAfter of the // call instruction - int StackOff = PRA.mcInfo.pushTempValue(target, - target.findOptimalStorageSize(LR->getType())); + /**** NOTE: THIS SHOULD USE THE RIGHT SIZE FOR THE REG BEING PUSHED ****/ + int StackOff = PRA.mcInfo.pushTempValue(target, 8); + // target.findOptimalStorageSize(LR->getType())); MachineInstr *AdIBefCC, *AdIAftCC, *AdICpCC; MachineInstr *AdIBef, *AdIAft; @@ -1548,6 +1549,7 @@ void UltraSparcRegInfo::moveInst2OrdVec(vector &OrdVec, MachineInstr *AdIBef, *AdIAft; // TODO: Change 8 below + /**** NOTE: THIS SHOULD USE THE RIGHT SIZE FOR THE REG BEING PUSHED ****/ const int StackOff = PRA.mcInfo.pushTempValue(target, 8); // Save the UReg (%ox) on stack before it's destroyed -- cgit v1.2.3