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

Rafael Espindola espindola at google.com
Wed Dec 2 13:45:42 PST 2009


> I don't have any testcases that are better than the one for pr5406.  I'm not sure if it is safe to access a 24-bit struct as an i32.

If it is not, that is (almost) a testcase :-)

Consider

-----------------
struct foo {
char[3] a;
};

void f(struct foo x);
void g(int a, int b, int c, int d, struct foo x);
----------------------


We should expand this to

void @f(i32)
and
void @g(i32, i32, i32, i32, i16, i8)

That is, using i32 or i16 + i8 will depend on the value being on the
stack on in a register. Given that we would have to change
PassInIntegerRegisters to know what fraction of the type is being
passed in registers  (or implement byval for arm).

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list