]> gcc.gnu.org Git - gcc.git/commitdiff
ia64.c (ia64_function_arg_pass_by_reference): New.
authorRichard Henderson <rth@redhat.com>
Thu, 18 Apr 2002 20:28:39 +0000 (13:28 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 18 Apr 2002 20:28:39 +0000 (13:28 -0700)
        * 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

gcc/ChangeLog
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h

index 137640dd43ce8132215489d41f2f4e6191e1b9c2..7b71e96161c8646b2b1768336eb2ebcf47494c3d 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 2bf67b24f0f4d9e9c4a089b8dc23dfc37cc7a409..8b0d1852862ab9f89919ee7d310976983bc6e1b1 100644 (file)
@@ -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 *));
 
index 74cbf813ca40057c94d678cbe2c6e72cc3b2d8ef..d628dea91af747449914fe6d3b2edeec4bb8feff 100644 (file)
@@ -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;
+}
 \f
 /* 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)
index 8b0d3d8ae3506c755810fe2ca35430ebf36c60a6..fd880facde995afab0372dffaa912ac515b50624 100644 (file)
@@ -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
This page took 0.089997 seconds and 5 git commands to generate.