Round up the size of byval arguments to MinAlign
authorReid Kleckner <reid@kleckner.net>
Wed, 6 Aug 2014 17:57:23 +0000 (17:57 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 6 Aug 2014 17:57:23 +0000 (17:57 +0000)
commit968823946949925bcc68163bed41b6a1da90a677
treec0a08a6b0eab327481fd7e7ddbcc1006be8ab41a
parent2669f9b34e69ff2c603e32ccd440740c247431c2
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
lib/CodeGen/CallingConvLower.cpp
test/CodeGen/X86/byval-callee-cleanup.ll [new file with mode: 0644]