Commit f2d0440f by Stephane Carrez Committed by Stephane Carrez

m68hc11.h (PAD_VARARGS_DOWN): Define and return according to va_arg type.

	* config/m68hc11/m68hc11.h (PAD_VARARGS_DOWN): Define and return
	according to va_arg type.
	(EXPAND_BUILTIN_VA_ARG): Remove.
	* config/m68hc11/m68hc11.c (m68hc11_va_arg): Remove.
	* config/m68hc11/m68hc11-protos.h (m68hc11_va_arg): Remove.

From-SVN: r63859
parent 1c442892
2003-03-05 Stephane Carrez <stcarrez@nerim.fr>
* config/m68hc11/m68hc11.h (PAD_VARARGS_DOWN): Define and return
according to va_arg type.
(EXPAND_BUILTIN_VA_ARG): Remove.
* config/m68hc11/m68hc11.c (m68hc11_va_arg): Remove.
* config/m68hc11/m68hc11-protos.h (m68hc11_va_arg): Remove.
2003-03-05 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (rs6000_variable_issue): Remove unnecessary
......
......@@ -138,8 +138,6 @@ extern int m68hc11_function_arg_pass_by_reference PARAMS((const CUMULATIVE_ARGS*
int));
extern int m68hc11_function_arg_padding PARAMS((enum machine_mode, tree));
extern rtx m68hc11_va_arg PARAMS((tree,tree));
extern void m68hc11_function_epilogue PARAMS((FILE*,int));
#endif /* TREE_CODE */
......
......@@ -1471,51 +1471,6 @@ m68hc11_function_arg (cum, mode, type, named)
return NULL_RTX;
}
rtx
m68hc11_va_arg (valist, type)
tree valist;
tree type;
{
tree addr_tree, t;
HOST_WIDE_INT align;
HOST_WIDE_INT rounded_size;
rtx addr;
int pad_direction;
/* Compute the rounded size of the type. */
align = PARM_BOUNDARY / BITS_PER_UNIT;
rounded_size = (((int_size_in_bytes (type) + align - 1) / align) * align);
/* Get AP. */
addr_tree = valist;
pad_direction = m68hc11_function_arg_padding (TYPE_MODE (type), type);
if (pad_direction == downward)
{
/* Small args are padded downward. */
HOST_WIDE_INT adj;
adj = TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_UNIT;
if (rounded_size > align)
adj = rounded_size;
addr_tree = build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree,
build_int_2 (rounded_size - adj, 0));
}
addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL);
addr = copy_to_reg (addr);
/* Compute new value for AP. */
t = build (MODIFY_EXPR, TREE_TYPE (valist), valist,
build (PLUS_EXPR, TREE_TYPE (valist), valist,
build_int_2 (rounded_size, 0)));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
return addr;
}
/* If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
`enum direction': either `upward' to pad above the argument,
......
......@@ -1047,6 +1047,10 @@ typedef struct m68hc11_args
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
m68hc11_function_arg_padding ((MODE), (TYPE))
#undef PAD_VARARGS_DOWN
#define PAD_VARARGS_DOWN \
(m68hc11_function_arg_padding (TYPE_MODE (type), type) == downward)
/* A C expression that indicates when it is the called function's
responsibility to make a copy of arguments passed by invisible
reference. Normally, the caller makes a copy and passes the
......@@ -1093,10 +1097,6 @@ typedef struct m68hc11_args
caller saving results in spill failure. */
#define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0
/* Implement `va_arg'. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
m68hc11_va_arg (valist, type)
/* For an arg passed partly in registers and partly in memory,
this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment