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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2011-06-09 00:15:19 +00:00
parent 471e422480
commit efe12907dd
2 changed files with 61 additions and 0 deletions

View File

@ -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<CCState*>(this), Size);
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));