support for >4G stack frames
authorChris Lattner <sabre@nondot.org>
Wed, 25 Apr 2007 04:30:24 +0000 (04:30 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Apr 2007 04:30:24 +0000 (04:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36425 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp
lib/Target/X86/X86RegisterInfo.cpp

index a79ba2972eaa8ba269406486dbc1d1e66213240c..d1ed0bbbc30485f463962b7f2dea1e4597a3cefb 100644 (file)
@@ -455,7 +455,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
       Offset += FFI->getMaxCallFrameSize();
 
     unsigned AlignMask = TFI.getStackAlignment() - 1;
-    Offset = (Offset + AlignMask) & ~AlignMask;
+    Offset = (Offset + AlignMask) & ~uint64_t(AlignMask);
   }
 
   // Update frame info to pretend that this is part of the stack...
index 1d11662232f8cbb339bd376465605d7c420ed1e5..007570e69ee29190f1d2d51bd9a97b7c79f1310f 100644 (file)
@@ -1036,7 +1036,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
   unsigned FrameLabelId = 0;
   
   // Get the number of bytes to allocate from the FrameInfo
-  unsigned NumBytes = MFI->getStackSize();
+  uint64_t NumBytes = MFI->getStackSize();
 
   if (NumBytes) {   // adjust stack pointer: ESP -= numbytes
     if (NumBytes >= 4096 && Subtarget->isTargetCygMing()) {
@@ -1091,7 +1091,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
   if (hasFP(MF)) {
     // Get the offset of the stack slot for the EBP register... which is
     // guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
-    int EBPOffset = MFI->getObjectOffset(MFI->getObjectIndexBegin())+SlotSize;
+    int64_t EBPOffset =
+      MFI->getObjectOffset(MFI->getObjectIndexBegin())+SlotSize;
     // Update the frame offset adjustment.
     MFI->setOffsetAdjustment(SlotSize-NumBytes);
     
@@ -1128,7 +1129,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
     // Add callee saved registers to move list.
     const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
     for (unsigned I = 0, E = CSI.size(); I != E; ++I) {
-      int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
+      int64_t Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
       unsigned Reg = CSI[I].getReg();
       MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
       MachineLocation CSSrc(Reg);