This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
RE: sh4 abi doc
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: "Clarke, Stephen" <stephen dot clarke at superh dot com>
- Cc: "Elena Zannoni" <ezannoni at redhat dot com>, <gdb at sources dot redhat dot com>
- Date: Thu, 26 Sep 2002 15:42:53 -0400
- Subject: RE: sh4 abi doc
- References: <287E4644B5249D449C56FA5409A874AE03EFBB@sh-us-ex01.us.w2k.superh.com>
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.
Thanks
Elena