]> gcc.gnu.org Git - gcc.git/commitdiff
c4x.h (EXPAND_BUILTIN_VA_ARG): New.
authorRichard Henderson <rth@cygnus.com>
Mon, 26 Jul 1999 23:44:33 +0000 (16:44 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 26 Jul 1999 23:44:33 +0000 (16:44 -0700)
        * c4x.h (EXPAND_BUILTIN_VA_ARG): New.
        * c4x.c (c4x_va_arg): New.

From-SVN: r28277

gcc/ChangeLog
gcc/config/c4x/c4x.c
gcc/config/c4x/c4x.h

index 8c7a30bd4db9f2272d78410a5037fe74959fae46..efb69f3b02d8fa4a9d734373333061a95f3d8451 100644 (file)
@@ -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
index 23f8bfa093f57e2afa5d1f025eb59f0e9fd1ef7a..0071fd54c7fed8f90bf4fa2cd838372b5ed5595e 100644 (file)
@@ -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)
index 7ef0738f00841d2e856fb75197e94cd1d45a959d..9f465d37d0b374f895ddcc24af22cdb435f95011 100644 (file)
@@ -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  */
 
This page took 0.075348 seconds and 5 git commands to generate.