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

Bob Wilson bob.wilson at apple.com
Tue Dec 1 13:41:29 PST 2009


Hi Rafael,

I've spent some time studying this more closely and comparing llvm-gcc's argument passing for x86, ppc, and arm, and I don't think your patch is the right way to go.  x86 and ppc handle most aggregate arguments with either the "mixed regs" or "byval" hooks, and rarely if ever fall through to the "integer regs" code.  (The x86-64 code is quite a bit more complicated than the others so I didn't try to follow all the paths through it, and it may use the "integer regs" code sometimes.)

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.

Adding "byval" support to ARM should be straightforward, but it's not a quick fix.

On Nov 25, 2009, at 8:18 PM, Rafael Espindola wrote:

> 2009/11/12 Bob Wilson <bob.wilson at apple.com>:
>> It's breaking something on ARM, too.  I'll revert it for now.
>> 
>> I did run gcc's compat tests, but not on PPC.  I guess I'll need to do
>> that.
> 
> Can you try the patch I attached to the bug?
> 
> Is there an easy way to get just a pass/fail list from the test-suite?
> I found the testcase in the bug report by doing
> 
> gmake TEST=nightly report report.html
> 
> in the SingleSource directory both with and without r86892 and
> searching for FAIL in the output.
> 
> Cheers,
> -- 
> Rafael Ávila de Espíndola





More information about the llvm-commits mailing list