------- Comment #2 from mikulas at artax dot karlin dot mff dot cuni dot cz  
2009-08-11 20:48 -------
Another inconsistency: struct { float f }; is returned in ST(0) in GCC and in
EAX on Windows. struct { double f }; is returned in ST(0) in GCC and in EDX:EAX
on Windows. See PR 41017 for more examples.

Another one: On Windows, structure with zero size ( struct { int a[0]; }) is
treated like having size 4 when passing arguments and treated like being
returned in registers (well, really, there is nothing returned because the
structure is empty, but it differs from GCC: GCC will pass dummy return place
argument and Windows won't).

Another one: struct { int a; int b[]; } is treated like having variable-size
and allways returned by reference in GCC. In Windows b[] and b[0] seem to be
equivalent and this is treated like having the size 4 and returned in EAX.

I also quite didn't get the purpose of MS_AGGREGATE_RETURN --- it seems to be
doing the same thing as -freg-struct-return in current gcc code. How are these
two supposed to differ? But it could be used to differentiate this
zero-sized-member thing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41013

  • [Bug target/41013] Ne... mikulas at artax dot karlin dot mff dot cuni dot cz
    • [Bug target/41013... mikulas at artax dot karlin dot mff dot cuni dot cz
    • [Bug target/41013... mikulas at artax dot karlin dot mff dot cuni dot cz

Reply via email to