OSDN Git Service

* config/frv/frv-protos.h (frv_expand_builtin_va_arg): Remove.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Jul 2004 23:53:14 +0000 (23:53 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Jul 2004 23:53:14 +0000 (23:53 +0000)
        * config/frv/frv.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
        (frv_gimplify_va_arg_expr): Rewrite from frv_expand_builtin_va_arg.
        * config/frv/frv.h (EXPAND_BUILTIN_VA_ARG): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84329 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c2993d2..63a702b 100644 (file)
@@ -1,5 +1,10 @@
 2004-07-08  Richard Henderson  <rth@redhat.com>
 
+       * config/frv/frv-protos.h (frv_expand_builtin_va_arg): Remove.
+       * config/frv/frv.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
+       (frv_gimplify_va_arg_expr): Rewrite from frv_expand_builtin_va_arg.
+       * config/frv/frv.h (EXPAND_BUILTIN_VA_ARG): Remove.
+
        * config/i860/i860-protos.h (i860_va_arg): Remove.
        * config/i860/i860.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
        (i860_gimplify_va_arg_expr): Rewrite from i860_va_arg.
index 3a0e386..a7a8ee6 100644 (file)
@@ -93,7 +93,6 @@ extern int frv_function_arg_callee_copies     (CUMULATIVE_ARGS *,
                                                 tree, int);
 
 extern void frv_expand_builtin_va_start                (tree, rtx);
-extern rtx frv_expand_builtin_va_arg           (tree, tree);
 #endif /* TREE_CODE */
 
 extern int frv_expand_block_move               (rtx *);
index de1cb37..9866320 100644 (file)
@@ -286,6 +286,7 @@ static void frv_output_const_unspec         (FILE *,
                                                 const struct frv_unspec *);
 static bool frv_function_ok_for_sibcall                (tree, tree);
 static rtx frv_struct_value_rtx                        (tree, int);
+static tree frv_gimplify_va_arg_expr           (tree, tree, tree *, tree *);
 \f
 /* Initialize the GCC target structure.  */
 #undef  TARGET_ASM_FUNCTION_PROLOGUE
@@ -331,6 +332,8 @@ static rtx frv_struct_value_rtx                     (tree, int);
 #define TARGET_EXPAND_BUILTIN_SAVEREGS frv_expand_builtin_saveregs
 #undef TARGET_SETUP_INCOMING_VARARGS
 #define TARGET_SETUP_INCOMING_VARARGS frv_setup_incoming_varargs
+#undef TARGET_GIMPLIFY_VA_ARG_EXPR
+#define TARGET_GIMPLIFY_VA_ARG_EXPR frv_gimplify_va_arg_expr
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
@@ -2081,30 +2084,13 @@ frv_expand_builtin_va_start (tree valist, rtx nextarg)
 \f
 /* Expand __builtin_va_arg to do the va_arg macro.  */
 
-rtx
-frv_expand_builtin_va_arg (tree valist, tree type)
+static tree
+frv_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
 {
-  rtx addr;
-  rtx mem;
-  rtx reg;
-
-  if (TARGET_DEBUG_ARG)
-    {
-      fprintf (stderr, "va_arg:\n");
-      debug_tree (type);
-    }
-
-  if (! AGGREGATE_TYPE_P (type))
-    return std_expand_builtin_va_arg (valist, type);
-
-  addr = std_expand_builtin_va_arg (valist, ptr_type_node);
-  mem  = gen_rtx_MEM (Pmode, addr);
-  reg  = gen_reg_rtx (Pmode);
-
-  set_mem_alias_set (mem, get_varargs_alias_set ());
-  emit_move_insn (reg, mem);
-
-  return reg;
+  if (AGGREGATE_TYPE_P (type))
+    return ind_gimplify_va_arg_expr (valist, type, pre_p, post_p);
+  else
+    return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
 }
 
 \f
index 2b53bb8..29d22e4 100644 (file)
@@ -2147,12 +2147,6 @@ struct machine_function GTY(())
 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG)               \
   (frv_expand_builtin_va_start(VALIST, NEXTARG))
 
-/* Implement the stdarg/varargs va_arg macro.  VALIST is the variable of type
-   va_list as a tree, TYPE is the type passed to va_arg.  */
-
-#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE)                            \
-  (frv_expand_builtin_va_arg (VALIST, TYPE))
-
 \f
 /* Trampolines for Nested Functions.  */