aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-04-18 13:28:39 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-04-18 13:28:39 -0700
commit51dcde6f95c8a107e0fb143210122eb49ee3c421 (patch)
treea68bf81a9dde32eb7fcde964fe821cc364ee470f /gcc
parenta48632153d7f6013126d9a73125fbef7c05268c4 (diff)
downloadgcc-51dcde6f95c8a107e0fb143210122eb49ee3c421.zip
gcc-51dcde6f95c8a107e0fb143210122eb49ee3c421.tar.gz
gcc-51dcde6f95c8a107e0fb143210122eb49ee3c421.tar.bz2
ia64.c (ia64_function_arg_pass_by_reference): New.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/ia64/ia64-protos.h3
-rw-r--r--gcc/config/ia64/ia64.c20
-rw-r--r--gcc/config/ia64/ia64.h3
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 137640d..7b71e96 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
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.
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 2bf67b2..8b0d185 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -114,6 +114,9 @@ extern int ia64_function_arg_partial_nregs PARAMS((CUMULATIVE_ARGS *,
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 *));
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 74cbf81..d628dea 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -3200,6 +3200,19 @@ ia64_function_arg_advance (cum, mode, type, named)
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;
+}
/* Implement va_start. */
@@ -3231,6 +3244,13 @@ ia64_va_arg (valist, type)
{
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)
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 8b0d3d8..fd880fa 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1268,7 +1268,8 @@ enum reg_class
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