This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: sh4 abi doc
Clarke, Stephen writes:
> > From: Elena Zannoni [mailto:ezannoni@redhat.com]
> > Sent: Thursday, September 26, 2002 10:43 AM
> >
> > The cutoff is 8 bytes.
>
> Yes: anything bigger than 8 bytes is definitely
> returned in memory.
>
> But the cutoff is not "clean", because structs smaller
> than this could also be returned in memory, if they
> don't pass the "same size and alignment as an integer
> type" rule.
>
> For example, in
>
> struct s { char c[3]; } wibble;
> struct s foo(void) { return wibble; }
>
> the return value from foo() will be in memory, not
> in R0, because there is no 3-byte integer type.
>
> Sorry if that was obvious already, I just wanted to
> be sure.
>
> Steve.
Very helpful. I hadn't noticed this variant, indeed.
Ah, the ``gcc struct return'' rule. Perhaphs we need a generic function
that specifies this.
enjoy,
Andrew