From 11edab6a4667f5c3900bc3000b87a5a1eb3dd938 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 9 Jun 2011 00:15:19 +0000 Subject: If the alignment of the byval argument is greater than the alignment of the frame then increase the maximum alignment of the frame to match. Fixes PR6965 llvm-svn: 132764 --- llvm/lib/CodeGen/CallingConvLower.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen/CallingConvLower.cpp') diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/llvm/lib/CodeGen/CallingConvLower.cpp index dac2fef5b43..bc61ec8ed0a 100644 --- a/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/llvm/lib/CodeGen/CallingConvLower.cpp @@ -49,6 +49,8 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT, Size = MinSize; if (MinAlign > (int)Align) Align = MinAlign; + if (MF.getFrameInfo()->getMaxAlignment() < Align) + MF.getFrameInfo()->setMaxAlignment(Align); TM.getTargetLowering()->HandleByVal(const_cast(this), Size); unsigned Offset = AllocateStack(Size, Align); addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); -- cgit v1.2.3