* config/ia64/ia64.c (ia64_function_arg_pass_by_reference): New.
(ia64_va_arg): Expect variable sized types by reference.
* config/ia64/ia64-protos.h: Update.
* config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use
ia64_function_arg_pass_by_reference.
From-SVN: r52494
2002-04-18 Richard Henderson <rth@redhat.com>
+ * config/ia64/ia64.c (ia64_function_arg_pass_by_reference): New.
+ (ia64_va_arg): Expect variable sized types by reference.
+ * config/ia64/ia64-protos.h: Update.
+ * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use
+ ia64_function_arg_pass_by_reference.
+
+2002-04-18 Richard Henderson <rth@redhat.com>
+
* ifcvt.c: Include except.h.
(block_has_only_trap): Break out from find_cond_trap.
(find_cond_trap): Use it. Always delete the trap block.
extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *,
enum machine_mode,
tree, int));
+extern int ia64_function_arg_pass_by_reference PARAMS((CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int));
extern int ia64_return_in_memory PARAMS((tree));
extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
cum->int_regs = cum->words;
}
}
+
+/* Variable sized types are passed by reference. */
+/* ??? At present this is a GCC extension to the IA-64 ABI. */
+
+int
+ia64_function_arg_pass_by_reference (cum, mode, type, named)
+ CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+ tree type;
+ int named ATTRIBUTE_UNUSED;
+{
+ return TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST;
+}
\f
/* Implement va_start. */
{
tree t;
+ /* Variable sized types are passed by reference. */
+ if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
+ {
+ rtx addr = std_expand_builtin_va_arg (valist, build_pointer_type (type));
+ return gen_rtx_MEM (ptr_mode, force_reg (Pmode, addr));
+ }
+
/* Arguments with alignment larger than 8 bytes start at the next even
boundary. */
if (TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
pointer is passed in whatever way is appropriate for passing a pointer to
that type. */
-#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
+#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
+ ia64_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
/* 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