This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Returning structures
- To: gcc at gcc dot gnu dot org
- Subject: Returning structures
- From: Geoffrey Keating <geoffk at thief dot cygnus dot com>
- Date: Tue, 13 Feb 2001 18:15:45 -0800
The PowerPC ELF ABI, at least, has wording like
structures or unions that do not meet the requirements for being
returned in registers are returned in a storage buffer allocated
by the caller. The address of this buffer is passed as a hidden
argument ...
Sometimes, GCC will decide it needs not allocate a buffer, instead
using some other place for the data. This causes testcase
execute/20010124-1.c to fail, as the called routine expects that the
buffer is distinct from any other memory it knows about and given the
wording above this is reasonable. So I intend to change calls.c so
that it always allocates a buffer.
Does anyone know of any ABIs which do not have this requirement? I am
wondering if this should be left conditional or removed altogether.
--
Geoff Keating <geoffk@redhat.com>