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)
commita6399a519d4d89602ecf918b3d6841601095a648
tree2c3fc2e982c8f28770126ae2bcf744fd50c83d6d
parent7f1c5472b573bd92220891804e9130f853446c35
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).

llvm-svn: 165615
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/arm-arguments.c