From 28cb76675ea1383deb22651d8f3459bb76d8b2bf Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 8 Jul 2004 16:53:14 -0700 Subject: [PATCH] frv-protos.h (frv_expand_builtin_va_arg): Remove. * 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. From-SVN: r84329 --- gcc/ChangeLog | 5 +++++ gcc/config/frv/frv-protos.h | 1 - gcc/config/frv/frv.c | 32 +++++++++----------------------- gcc/config/frv/frv.h | 6 ------ 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2993d28995..63a702bc2e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-07-08 Richard Henderson + * 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. diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 3a0e386d25d..a7a8ee667f6 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -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 *); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index de1cb379095..98663202297 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -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 *); /* 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; @@ -2081,30 +2084,13 @@ frv_expand_builtin_va_start (tree valist, rtx nextarg) /* 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); } diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 2b53bb8cf09..29d22e44fb9 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -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)) - /* Trampolines for Nested Functions. */ -- 2.30.2