Always compute max align.
authorChris Lattner <sabre@nondot.org>
Sun, 6 Nov 2005 17:43:20 +0000 (17:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Nov 2005 17:43:20 +0000 (17:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24227 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp

index 95932207a585caaaafa5d3f3ad823020866bf305..b3bf88d6893d5669f4f667fb8b734900ccd75b39 100644 (file)
@@ -258,7 +258,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   MachineFrameInfo *FFI = Fn.getFrameInfo();
 
   unsigned StackAlignment = TFI.getStackAlignment();
-  unsigned MaxAlign = StackAlignment;
+  unsigned MaxAlign = 0;
 
   // Start at the beginning of the local area.
   // The Offset is the distance from the stack top in the direction
@@ -318,11 +318,10 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
 
   // Set the final value of the stack pointer...
   FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea());
-  // If we have a new stack alignment, set the preferred stack alignment so that
-  // the targets can do the appropriate thing to properly align the stack above
-  // the default alignment.
-  if (MaxAlign > StackAlignment)
-    FFI->setMaxAlignment(MaxAlign);
+
+  // Remember the required stack alignment in case targets need it to perform
+  // dynamic stack alignment.
+  FFI->setMaxAlignment(MaxAlign);
 }