diff options
Diffstat (limited to 'gcc/config/c4x/c4x.c')
-rw-r--r-- | gcc/config/c4x/c4x.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 23f8bfa..0071fd5 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -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) |