[llvm-commits] [llvm-gcc-4.2] r86892 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h

Rafael Espindola espindola at google.com
Tue Dec 1 15:06:42 PST 2009


> Instead, I think the ARM backend needs to handle "byval" arguments.  That is how both x86 and ppc handle the testcase in pr5406.  I don't think it is possible to fix the PassInIntegerRegisters code to correctly handle aggregates that are not a multiple of the register size, at least not without much more extensive changes.  You either end up accessing memory past the end of the argument (as Dale pointed out earlier) or splitting the tail into pieces, which is wrong depending on whether each piece is in a separate register or in memory.

Why do you think so? Do you have an example where the new patch fails?

The byval argument was introduced to handle cases in the ELF x86_64
abi where it is not possible to map how a struct is passed to an
equivalent way of passing primitive types. It also had some additional
benefits in the end.

Do you have a case in the ARM ABI where we cannot map a struct passing
to an equivalent way of passing primitive types? If so, I can try to
implement byval for ARM, but it will take me some time to get to it.
If not, I would suggest doing the quick fix first.

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list