This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
ia64 abi vs variable sized data types
- From: Richard Henderson <rth at redhat dot com>
- To: Cary Coutant <cary at cup dot hp dot com>, "Rao, Suresh K" <suresh dot k dot rao at intel dot com>, Jim Wilson <wilson at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Apr 2002 17:13:10 -0800
- Subject: ia64 abi vs variable sized data types
[ Hopefully either one or both of you are close enough to the
correct body to get this addressed in a future revision of
the ABI. ]
The IA-64 ABI specifies that aggregates are to be passed by
value, in registers and on the stack as position and size
dictates. It does not, however, say anything about variable
sized aggregates, and it is between difficult and impossible
to treat them similarly.
While for C, I'm pretty sure that variable sized aggregates
are a GCC extension, they have always existed in Ada.
Up until today, gcc handled these by passing them by value
on the stack only (i.e. never any part in registers), which
worked relatively well by itself. But I've discovered that
that fails with va_arg, since with 'void *' for va_list,
we cannot skip over the part of the varargs that came from
registers. [E.g. http://subversions.gnu.org/cgi-bin/viewcvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20020307-2.c?rev=1.3&content-type=text/vnd.viewcvs-markup ]
Therefore, I propose to change gcc such that such variable
sized aggregates are passed by reference instead. Given the
obscurity of the subject, I suspect this change affects almost
no real applications yet.
Comments?
r~