aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-08 13:34:26 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-08 13:34:26 -0700
commitd222b827dcf997b0d161a0741017df029fa4d5d9 (patch)
tree9c89a6a4ad1f5a69daade8dc6d7a5824d2a5072f /gcc
parent09eeca5e301971b7ff49d0432b5352ff11aa4f91 (diff)
downloadgcc-d222b827dcf997b0d161a0741017df029fa4d5d9.zip
gcc-d222b827dcf997b0d161a0741017df029fa4d5d9.tar.gz
gcc-d222b827dcf997b0d161a0741017df029fa4d5d9.tar.bz2
c4x-protos.h (c4x_va_arg): Remove.
* config/c4x/c4x-protos.h (c4x_va_arg): Remove. * config/c4x/c4x.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. (c4x_gimplify_va_arg_expr): Rewrite from c4x_va_arg. * config/c4x/c4x.h (EXPAND_BUILTIN_VA_ARG): Remove. From-SVN: r84311
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/c4x/c4x-protos.h2
-rw-r--r--gcc/config/c4x/c4x.c16
-rw-r--r--gcc/config/c4x/c4x.h5
4 files changed, 19 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e568892..9f84fcc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-08 Richard Henderson <rth@redhat.com>
+
+ * config/c4x/c4x-protos.h (c4x_va_arg): Remove.
+ * config/c4x/c4x.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New.
+ (c4x_gimplify_va_arg_expr): Rewrite from c4x_va_arg.
+ * config/c4x/c4x.h (EXPAND_BUILTIN_VA_ARG): Remove.
+
2004-07-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.md (prefetch_32, prefetch_64): Simplify constraint checks.
diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h
index 5e79c1f..6189f7d 100644
--- a/gcc/config/c4x/c4x-protos.h
+++ b/gcc/config/c4x/c4x-protos.h
@@ -56,8 +56,6 @@ extern struct rtx_def *c4x_function_arg (CUMULATIVE_ARGS *,
#if defined(RTX_CODE) && defined(TREE_CODE)
extern void c4x_init_cumulative_args (CUMULATIVE_ARGS *c, tree, rtx);
-extern struct rtx_def *c4x_va_arg (tree, tree);
-
extern rtx c4x_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
extern void c4x_init_builtins (void);
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 22aab7d..dff0da4 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -202,6 +202,7 @@ static int c4x_address_cost (rtx);
static void c4x_init_libfuncs (void);
static void c4x_external_libcall (rtx);
static rtx c4x_struct_value_rtx (tree, int);
+static tree c4x_gimplify_va_arg_expr (tree, tree, tree *, tree *);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_BYTE_OP
@@ -255,6 +256,9 @@ static rtx c4x_struct_value_rtx (tree, int);
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX c4x_struct_value_rtx
+#undef TARGET_GIMPLIFY_VA_ARG_EXPR
+#define TARGET_GIMPLIFY_VA_ARG_EXPR c4x_gimplify_va_arg_expr
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Override command line options.
@@ -722,16 +726,20 @@ c4x_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
/* C[34]x arguments grow in weird ways (downwards) that the standard
varargs stuff can't handle.. */
-rtx
-c4x_va_arg (tree valist, tree type)
+
+static tree
+c4x_gimplify_va_arg_expr (tree valist, tree type,
+ tree *pre_p ATTRIBUTE_UNUSED,
+ tree *post_p ATTRIBUTE_UNUSED)
{
tree t;
t = build (PREDECREMENT_EXPR, TREE_TYPE (valist), valist,
build_int_2 (int_size_in_bytes (type), 0));
- TREE_SIDE_EFFECTS (t) = 1;
+ t = fold_convert (build_pointer_type (type), t);
+ t = build_fold_indirect_ref (t);
- return expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
+ return t;
}
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index cff2548..823a608 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1162,11 +1162,6 @@ CUMULATIVE_ARGS;
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Varargs handling. */
-
-#define EXPAND_BUILTIN_VA_ARG(valist, type) \
- c4x_va_arg (valist, type)
-
/* Generating Code for Profiling. */
/* Note that the generated assembly uses the ^ operator to load the 16