diff options
author | Richard Henderson <rth@cygnus.com> | 1999-07-26 16:44:33 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-07-26 16:44:33 -0700 |
commit | cc7fd3980a3e22fe7740e07a94b29fae59c840ea (patch) | |
tree | 7ac4195df46d2d945e8363533f275986b6ef83b5 /gcc | |
parent | 1946537baae0c1012b0ab5a58c4f514189d885f5 (diff) | |
download | gcc-cc7fd3980a3e22fe7740e07a94b29fae59c840ea.zip gcc-cc7fd3980a3e22fe7740e07a94b29fae59c840ea.tar.gz gcc-cc7fd3980a3e22fe7740e07a94b29fae59c840ea.tar.bz2 |
c4x.h (EXPAND_BUILTIN_VA_ARG): New.
* c4x.h (EXPAND_BUILTIN_VA_ARG): New.
* c4x.c (c4x_va_arg): New.
From-SVN: r28277
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.c | 15 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.h | 4 |
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c7a30b..efb69f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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 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) diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index 7ef0738..9f465d3 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -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 */ |