]> granicus.if.org Git - clang/commit
Apply the same fundamental fix for PR14048 as was applied for PR11905.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 10 Oct 2012 11:29:08 +0000 (11:29 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 10 Oct 2012 11:29:08 +0000 (11:29 +0000)
commitf82232c8b73851337b83b954ba1292cf6475c7c5
tree82daa1af8c1452d0fed3440f53161da621fb5042
parent603571a2d6daca43162bf1d9469baf919697c00a
Apply the same fundamental fix for PR14048 as was applied for PR11905.

The issue arises when coercing to/from types of different sizes. We need
to be certain that the allocation on either end has sufficient room for
the coerced type. When it doesn't, we need to make room, copy across,
and then proceed. PR11905 handled the case of storing function arguments
back into allocas in the function prolog, this patch handles the case of
setting up the function arguments in a call expression.

This is actually significantly simpler than the fix for PR11905. It ends
up being a trivial change to create a temporary alloca when the source
is too small and memcpy across. This should preserve the compile-time
fast-isel benefits of doing gep+load sequences and avoiding FCAs.

Reviewed by Benjamin and Evgeniy (who fixed PR11905).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165615 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
test/CodeGen/arm-arguments.c