This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rs6000 struct returns
- To: "James L. Dein" <jdein at windriver dot com>
- Subject: Re: rs6000 struct returns
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 19 Mar 2001 17:48:03 -0800
- CC: gcc at gcc dot gnu dot org
- References: <200103200100.RAA01596@lackawaxen.wrs.com>
"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>