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
This commit is contained in:
Eric Christopher
2011-06-09 00:15:19 +00:00
parent 0713a9d8fc
commit 11edab6a46
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));