diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-08 16:53:14 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-08 16:53:14 -0700 |
commit | 28cb76675ea1383deb22651d8f3459bb76d8b2bf (patch) | |
tree | 49f92788482633684c87e0866bdaaf28129ab233 /gcc/config/frv | |
parent | c6db08cd564e877e192e1c499ab51cf04102eaa9 (diff) | |
download | gcc-28cb76675ea1383deb22651d8f3459bb76d8b2bf.zip gcc-28cb76675ea1383deb22651d8f3459bb76d8b2bf.tar.gz gcc-28cb76675ea1383deb22651d8f3459bb76d8b2bf.tar.bz2 |
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
Diffstat (limited to 'gcc/config/frv')
-rw-r--r-- | gcc/config/frv/frv-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 32 | ||||
-rw-r--r-- | gcc/config/frv/frv.h | 6 |
3 files changed, 9 insertions, 30 deletions
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 3a0e386..a7a8ee6 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 de1cb37..9866320 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 2b53bb8..29d22e4 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. */ |