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: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: gcc and struct passing in function arguments?
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Wed, 5 Jul 2000 21:59:37 +0100 (BST)
- CC: David dot Young at vviuh221 dot vvi dot com, gcc at gcc dot gnu dot org
> 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.
i386-linux has several ABIs. linux-elf uses the SYSV ABI and therefore
returns structures and unions in memory. linux-aout returns them in
registers if the mode is suitable (i.e. SImode or DImode).
You can use -freg-struct-return with linux-elf, but it causes problems
if you link with any library function that returns a struct, or call one
that gets passed a pointer to a function that returns a struct.