Commit cc7fd398 by Richard Henderson Committed by Richard Henderson

c4x.h (EXPAND_BUILTIN_VA_ARG): New.

        * c4x.h (EXPAND_BUILTIN_VA_ARG): New.
        * c4x.c (c4x_va_arg): New.

From-SVN: r28277
parent 1946537b
Mon Jul 26 16:43:26 1999 Richard Henderson <rth@cygnus.com>
* c4x.h (EXPAND_BUILTIN_VA_ARG): New.
* c4x.c (c4x_va_arg): New.
Mon Jul 26 12:30:09 1999 Jason Merrill <jason@yorick.cygnus.com>
* cpplib.c (cpp_get_token): Don't return a CPP_POP if the buffer
......
......@@ -572,6 +572,21 @@ c4x_function_arg (cum, mode, type, named)
return NULL_RTX;
}
/* C[34]x arguments grow in weird ways (downwards) that the standard
varargs stuff can't handle. */
rtx
c4x_va_arg (valist, type)
tree valist, type;
{
tree t;
t = build (PREDECREMENT_EXPR, TREE_TYPE (valist), valist,
build_int_2 (int_size_in_bytes (type), 0));
TREE_SIDE_EFFECTS (t) = 1;
return expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
}
static int
c4x_isr_reg_used_p (regno)
......
......@@ -1157,6 +1157,10 @@ extern struct rtx_def *c4x_function_arg();
#define DEFAULT_PCC_STRUCT_RETURN 0
#define STRUCT_VALUE_REGNUM AR0_REGNO /* AR0 */
/* Varargs handling. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
c4x_va_arg (valist, type)
/* Function Entry and Exit */
......
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