m32r-protos.h (m32r_va_arg): Remove.

* config/m32r/m32r-protos.h (m32r_va_arg): Remove.
        * config/m32r/m32r.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
        (m32r_gimplify_va_arg_expr): Rewrite from m32r_va_arg.
        * config/m32r/m32r.h (EXPAND_BUILTIN_VA_ARG): Remove.

From-SVN: r84335
This commit is contained in:
Richard Henderson 2004-07-08 17:19:25 -07:00 committed by Richard Henderson
parent 3bc0b10f9d
commit 4e15608a31
4 changed files with 12 additions and 57 deletions

View File

@ -1,5 +1,10 @@
2004-07-08 Richard Henderson <rth@redhat.com>
* config/m32r/m32r-protos.h (m32r_va_arg): Remove.
* config/m32r/m32r.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
(m32r_gimplify_va_arg_expr): Rewrite from m32r_va_arg.
* config/m32r/m32r.h (EXPAND_BUILTIN_VA_ARG): Remove.
* config/iq2000/iq2000-protos.h (iq2000_va_arg): Remove.
* config/iq2000/iq2000.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
(iq2000_gimplify_va_arg_expr): Rewrite from iq2000_va_arg.

View File

@ -95,7 +95,6 @@ extern int reg_or_zero_operand (rtx, Mmode);
#endif /* HAVE_MACHINE_MODES */
#ifdef TREE_CODE
extern struct rtx_def * m32r_va_arg (tree, tree);
extern int m32r_pass_by_reference (tree);
#endif /* TREE_CODE */
#endif /* RTX_CODE */

View File

@ -99,6 +99,7 @@ static void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree, int *, int);
static void init_idents (void);
static bool m32r_rtx_costs (rtx, int, int, int *);
static tree m32r_gimplify_va_arg_expr (tree, tree, tree *, tree *);
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@ -142,6 +143,8 @@ static bool m32r_rtx_costs (rtx, int, int, int *);
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS m32r_setup_incoming_varargs
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR m32r_gimplify_va_arg_expr
struct gcc_target targetm = TARGET_INITIALIZER;
@ -1394,61 +1397,13 @@ m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
/* Implement `va_arg'. */
rtx
m32r_va_arg (tree valist, tree type)
static tree
m32r_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
{
HOST_WIDE_INT size, rsize;
tree t;
rtx addr_rtx;
size = int_size_in_bytes (type);
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
if (m32r_pass_by_reference (type))
{
tree type_ptr, type_ptr_ptr;
/* Pass by reference. */
type_ptr = build_pointer_type (type);
type_ptr_ptr = build_pointer_type (type_ptr);
t = build (POSTINCREMENT_EXPR, va_list_type_node, valist,
build_int_2 (UNITS_PER_WORD, 0));
TREE_SIDE_EFFECTS (t) = 1;
t = build1 (NOP_EXPR, type_ptr_ptr, t);
TREE_SIDE_EFFECTS (t) = 1;
t = build1 (INDIRECT_REF, type_ptr, t);
addr_rtx = expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
}
return ind_gimplify_va_arg_expr (valist, type, pre_p, post_p);
else
{
/* Pass by value. */
if (size < UNITS_PER_WORD)
{
/* Care for bigendian correction on the aligned address. */
t = build (PLUS_EXPR, ptr_type_node, valist,
build_int_2 (rsize - size, 0));
addr_rtx = expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
addr_rtx = copy_to_reg (addr_rtx);
/* Increment AP. */
t = build (PLUS_EXPR, va_list_type_node, valist,
build_int_2 (rsize, 0));
t = build (MODIFY_EXPR, va_list_type_node, valist, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
else
{
t = build (POSTINCREMENT_EXPR, va_list_type_node, valist,
build_int_2 (rsize, 0));
TREE_SIDE_EFFECTS (t) = 1;
addr_rtx = expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
}
}
return addr_rtx;
return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
}
/* Return true if INSN is real instruction bearing insn. */

View File

@ -1141,10 +1141,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
(((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) <= PARM_BOUNDARY \
? PARM_BOUNDARY : 2 * PARM_BOUNDARY)
#endif
/* Implement `va_arg'. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
m32r_va_arg (valist, type)
/* Function results. */