This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc and struct passing in function arguments?
- To: David dot Young at vviuh221 dot vvi dot com
- Subject: Re: gcc and struct passing in function arguments?
- From: Alan Lehotsky <lehotsky at sunspot dot tiac dot net>
- Date: Wed, 5 Jul 2000 16:45:39 -0400 (EDT)
- CC: gcc at gcc dot gnu dot org
Yes, gcc can pass and return structures by value. It is
implementation dependent how this is accomplished and whether the
values are returned via a caller-supplied temporary.
Many compilers will return structures that are 64 bits or smaller in
the result registers (assuming that doubles are returned in a pair
of 32 bit registers). All other compilers that I'm aware of pass a
hidden extra in-parameter that's the address of a structure temporary.
The called-function stores the results into that temporary.
-- Al