[llvm-commits] [llvm-gcc-4.2] r47743 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-abi.h

Dale Johannesen dalej at apple.com
Thu Feb 28 17:54:54 PST 2008


On Feb 28, 2008, at 5:42 PM, Dale Johannesen wrote:
> Compensate for an Undocumented Feature of darwin
> x86-32: a struct with a single data field and an
> arbitrary number of zero-length fields is returned
> as if it were the type of the single data field.
> This is not correct for ppc32, so I've added a
> target hook.  I don't know if it's correct for Linux
> x86-32, but this is not an area where we've made
> darwin-specific modifications, so I'm guessing it is.

The interesting case is something like

struct BB { int :0; float x; union {} b; int :0; };
struct BB zz() { struct BB ret; ret.x=3.0f; return ret; }

The return value goes in ST(0).




More information about the llvm-commits mailing list