aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index f237cbe04d..1fec4c9f56 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -438,6 +438,9 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
Offset += FFI->getObjectSize(SFI);
unsigned Align = FFI->getObjectAlignment(SFI);
+ // If the alignment of this object is greater than that of the
+ // stack, then increase the stack alignment to match.
+ MaxAlign = std::max(MaxAlign, Align);
// Adjust to alignment boundary
Offset = (Offset+Align-1)/Align*Align;