mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-14 14:33:40 +08:00
v850-protos.h (v850_va_arg): Remove.
* config/v850/v850-protos.h (v850_va_arg): Remove. * config/v850/v850.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. (v850_gimplify_va_arg_expr): Rewrite from v850_va_arg. * config/v850/v850.h (EXPAND_BUILTIN_VA_ARG): Remove. (FUNCTION_ARG_PASS_BY_REFERENCE): Handle variable size types. (FUNCTION_ARG_CALLEE_COPIES): Use FUNCTION_ARG_PASS_BY_REFERENCE. From-SVN: r84359
This commit is contained in:
parent
5d47df87a0
commit
a900345fb5
@ -1,3 +1,12 @@
|
||||
2004-07-09 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* config/v850/v850-protos.h (v850_va_arg): Remove.
|
||||
* config/v850/v850.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
|
||||
(v850_gimplify_va_arg_expr): Rewrite from v850_va_arg.
|
||||
* config/v850/v850.h (EXPAND_BUILTIN_VA_ARG): Remove.
|
||||
(FUNCTION_ARG_PASS_BY_REFERENCE): Handle variable size types.
|
||||
(FUNCTION_ARG_CALLEE_COPIES): Use FUNCTION_ARG_PASS_BY_REFERENCE.
|
||||
|
||||
2004-07-09 Richard Earnshaw <rearnsha@arm.com>
|
||||
|
||||
PR target/12133
|
||||
|
@ -70,7 +70,6 @@ extern int pattern_is_ok_for_epilogue (rtx, Mmode);
|
||||
extern int register_is_ok_for_epilogue (rtx, Mmode);
|
||||
#ifdef TREE_CODE
|
||||
extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int);
|
||||
extern rtx v850_va_arg (tree, tree);
|
||||
#endif
|
||||
#endif
|
||||
#endif /* TREE_CODE */
|
||||
|
@ -67,6 +67,7 @@ static void v850_encode_section_info (tree, rtx, int);
|
||||
static bool v850_return_in_memory (tree, tree);
|
||||
static void v850_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
|
||||
tree, int *, int);
|
||||
static tree v850_gimplify_va_arg_expr (tree, tree, tree *, tree *);
|
||||
|
||||
/* Information about the various small memory areas. */
|
||||
struct small_memory_info small_memory[ (int)SMALL_MEMORY_max ] =
|
||||
@ -132,6 +133,9 @@ static int v850_interrupt_p = FALSE;
|
||||
#undef TARGET_SETUP_INCOMING_VARARGS
|
||||
#define TARGET_SETUP_INCOMING_VARARGS v850_setup_incoming_varargs
|
||||
|
||||
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
|
||||
#define TARGET_GIMPLIFY_VA_ARG_EXPR v850_gimplify_va_arg_expr
|
||||
|
||||
struct gcc_target targetm = TARGET_INITIALIZER;
|
||||
|
||||
/* Sometimes certain combinations of command options do not make
|
||||
@ -3306,43 +3310,13 @@ construct_prepare_instruction (rtx op)
|
||||
|
||||
/* Implement `va_arg'. */
|
||||
|
||||
rtx
|
||||
v850_va_arg (tree valist, tree type)
|
||||
static tree
|
||||
v850_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
{
|
||||
HOST_WIDE_INT size, rsize;
|
||||
tree addr, incr;
|
||||
rtx addr_rtx;
|
||||
int indirect;
|
||||
|
||||
/* Round up sizeof(type) to a word. */
|
||||
size = int_size_in_bytes (type);
|
||||
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
|
||||
indirect = 0;
|
||||
|
||||
if (size > 8)
|
||||
{
|
||||
size = rsize = UNITS_PER_WORD;
|
||||
indirect = 1;
|
||||
}
|
||||
|
||||
addr = save_expr (valist);
|
||||
incr = fold (build (PLUS_EXPR, ptr_type_node, addr,
|
||||
build_int_2 (rsize, 0)));
|
||||
|
||||
incr = build (MODIFY_EXPR, ptr_type_node, valist, incr);
|
||||
TREE_SIDE_EFFECTS (incr) = 1;
|
||||
expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
addr_rtx = expand_expr (addr, NULL, Pmode, EXPAND_NORMAL);
|
||||
|
||||
if (indirect)
|
||||
{
|
||||
addr_rtx = force_reg (Pmode, addr_rtx);
|
||||
addr_rtx = gen_rtx_MEM (Pmode, addr_rtx);
|
||||
set_mem_alias_set (addr_rtx, get_varargs_alias_set ());
|
||||
}
|
||||
|
||||
return addr_rtx;
|
||||
if (FUNCTION_ARG_PASS_BY_REFERENCE (dummy, TYPE_MODE (type), type, 0))
|
||||
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);
|
||||
}
|
||||
|
||||
/* Return an RTX indicating where the return address to the
|
||||
|
@ -773,15 +773,11 @@ struct cum_arg { int nbytes; int anonymous_args; };
|
||||
space allocated by the caller. */
|
||||
#define OUTGOING_REG_PARM_STACK_SPACE
|
||||
|
||||
/* Implement `va_arg'. */
|
||||
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
|
||||
v850_va_arg (valist, type)
|
||||
|
||||
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
|
||||
((TYPE) && int_size_in_bytes (TYPE) > 8)
|
||||
((TYPE) && (unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 8)
|
||||
|
||||
#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \
|
||||
((TYPE) && int_size_in_bytes (TYPE) > 8)
|
||||
FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)
|
||||
|
||||
/* 1 if N is a possible register number for function argument passing. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user