mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Round up the size of byval arguments to MinAlign
Otherwise we can end up with an argument frame size that is not a multiple of stack slot size, which is very awkward. This fixes PR20547, which was a bug in x86_64 Sys V vararg handling. However, it's much easier to test this with x86 callee-cleanup functions, which previously ended in "retl $6" instead of "retl $8". This does affect behavior of all backends, but it presumably fixes the same bug in all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -52,6 +52,7 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
|
||||
Align = MinAlign;
|
||||
MF.getFrameInfo()->ensureMaxAlignment(Align);
|
||||
TM.getSubtargetImpl()->getTargetLowering()->HandleByVal(this, Size, Align);
|
||||
Size = unsigned(RoundUpToAlignment(Size, MinAlign));
|
||||
unsigned Offset = AllocateStack(Size, Align);
|
||||
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
|
||||
}
|
||||
|
Reference in New Issue
Block a user