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: gcc and struct passing in function arguments?



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

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