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?


On Wed, Jul 05, 2000 at 04:08:35PM -0400, David Young wrote:
> Hi!
> 
> Does anyone know if...
> 
> gcc can do struct passing in arguments and return of functions?
> (not pointer to struct, but struct by value)
> Is there a 32 byte limit (or similar) to this?
> Is this feature ANSI-C compliant?

It depends on the ABI.  Different ABI's do different things.  For example,
powerpc-eabi or powerpc-linux always passes structures by copying the structure
to a temporary location on the stack and passing the address of the temporary.
For AIX, the first 8 words of integral and structure arguments are passed in
registers and the remaining elements are passed on the stack.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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