[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
Lauro Ramos Venancio
lauro.venancio at gmail.com
Fri Feb 23 12:33:21 PST 2007
Changes in directory llvm/lib/Target/ARM:
ARMISelLowering.cpp updated: 1.16 -> 1.17
---
Log message:
Fix stack alignment in functions with varargs.
---
Diffs of the changes: (+5 -2)
ARMISelLowering.cpp | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.16 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.17
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.16 Thu Feb 22 08:56:36 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Feb 23 14:32:57 2007
@@ -831,13 +831,16 @@
SSARegMap *RegMap = MF.getSSARegMap();
MachineFrameInfo *MFI = MF.getFrameInfo();
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- unsigned VARegSaveSize = (4 - NumGPRs) * 4;
+ unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
+ unsigned VARegSize = (4 - NumGPRs) * 4;
+ unsigned VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1);
if (VARegSaveSize) {
// If this function is vararg, store any remaining integer argument regs
// to their spots on the stack so that they may be loaded by deferencing
// the result of va_next.
AFI->setVarArgsRegSaveSize(VARegSaveSize);
- VarArgsFrameIndex = MFI->CreateFixedObject(VARegSaveSize, ArgOffset);
+ VarArgsFrameIndex = MFI->CreateFixedObject(VARegSaveSize, ArgOffset +
+ VARegSaveSize - VARegSize);
SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
SmallVector<SDOperand, 4> MemOps;
More information about the llvm-commits
mailing list