This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Fix va-arg-22.c on ia64-hp-hpux11.2[3]
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 Dec 2003 21:37:43 -0800
- Subject: PATCH: Fix va-arg-22.c on ia64-hp-hpux11.2[3]
- Reply-to: mark at codesourcery dot com
Passing large numbers of varargs did not work correctly on IA64 HP-UX.
The reason is that GCC failed to implement the calling convention
specified by the ABI. In particular, all parameters -- even
aggregates -- are passed in registers until the eight outgoing
registers have been used. GCC was trying to pass aggregates on the
stack when in big-endian mode; the default definition of
MUST_PASS_IN_STACK is wrong for IA64.
Tested on ia64-hp-hpux11.23, applied on the mainline.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2003-12-05 Mark Mitchell <mark@codesourcery.com>
* config/ia64/ia64.h (MUST_PASS_IN_STACK): Define.
Index: ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.162
diff -c -5 -p -r1.162 ia64.h
*** ia64.h 4 Dec 2003 05:46:16 -0000 1.162
--- ia64.h 6 Dec 2003 01:42:11 -0000
*************** enum reg_class
*** 1326,1335 ****
--- 1326,1342 ----
that type. */
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
ia64_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
+ /* Nonzero if we do not know how to pass TYPE solely in registers. */
+
+ #define MUST_PASS_IN_STACK(MODE, TYPE) \
+ ((TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE)))
+
/* A C type for declaring a variable that is used as the first argument of
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far. */
typedef struct ia64_args