This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: rs6000 struct returns


"James L. Dein" <jdein@windriver.com> writes:

> According to the SVR4 ABI for rs6000, which is subsumed by the EABI, small 
> structs should be returned in r3/r4, if they fit.  However, gcc is not doing 
> that: instead, all structs are being returned just like large structs, i.e., via 
> a secret pointer arg to an area allocated by the caller.
> 
> Can anyone suggest how to implement the correct behavior?  It appears that 
> returning structs in single regs is easy to implement, but there is no support 
> for returning in more than one reg.

Have you tried -mcall-solaris?  That should add this behaviour,
although that's straight SVR4 not EABI.

For EABI, this is probably a straight bug.  Look at RETURN_IN_MEMORY
in rs6000.c.  The gotcha is that this can't immediately be changed for
linux; it's on my to-do-when-next-breaking-abi list.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]