From: Richard Henderson Date: Thu, 8 Jul 2004 22:03:57 +0000 (-0700) Subject: builtins.c (ind_gimplify_va_arg_expr): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=083385aae90eb4dff408962df34a096b846e081f;p=gcc.git builtins.c (ind_gimplify_va_arg_expr): New. * builtins.c (ind_gimplify_va_arg_expr): New. * tree.h (ind_gimplify_va_arg_expr): Declare. * config/arc/arc.c (arc_gimplify_va_arg_expr): Use it. From-SVN: r84317 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1dd50f9a5e9..18a2b3a8c76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-07-08 Richard Henderson + + * builtins.c (ind_gimplify_va_arg_expr): New. + * tree.h (ind_gimplify_va_arg_expr): Declare. + * config/arc/arc.c (arc_gimplify_va_arg_expr): Use it. + 2004-07-08 Jan Beulich * expmed.c (extract_bit_field): Correct condition to use vec_extract diff --git a/gcc/builtins.c b/gcc/builtins.c index c07ff044e3e..c620d44eeac 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4549,6 +4549,17 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) return build_fold_indirect_ref (addr); } +/* Like std_gimplify_va_arg_expr, but uses pass-by-reference. */ + +tree +ind_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) +{ + tree t; + t = build_pointer_type (type); + t = std_gimplify_va_arg_expr (valist, t, pre_p, post_p); + return build_fold_indirect_ref (t); +} + /* Return a dummy expression of type TYPE in order to keep going after an error. */ diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index ec2520d6762..6c3da47438e 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -2299,11 +2299,7 @@ arc_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) than 8 bytes are passed by reference. */ if (AGGREGATE_TYPE_P (type) || int_size_in_bytes (type) > 8) - { - tree type_ptr = build_pointer_type (type); - tree addr = std_gimplify_va_arg_expr (valist, type_ptr, pre_p, post_p); - return build_fold_indirect_ref (addr); - } + return ind_gimplify_va_arg_expr (valist, type, pre_p, post_p); return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); } diff --git a/gcc/tree.h b/gcc/tree.h index 4dab73f0f6d..af3d1d596e2 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3434,6 +3434,7 @@ extern tree strip_float_extensions (tree); extern tree simplify_builtin (tree, int); extern tree c_strlen (tree, int); extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *); +extern tree ind_gimplify_va_arg_expr (tree, tree, tree *, tree *); /* In convert.c */ extern tree strip_float_extensions (tree);