aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-stdarg.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-05-13 09:06:18 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-05-13 09:06:18 +0000
commitfcd424cecbe8874404fc92520954ec806e7886fc (patch)
tree329af8074710a22884ff6b12ff17c6f07afbea73 /gcc/tree-stdarg.c
parent7947dd0bdf9cfe2a704355b1e5d7c7f786c67b9b (diff)
downloadgcc-fcd424cecbe8874404fc92520954ec806e7886fc.zip
gcc-fcd424cecbe8874404fc92520954ec806e7886fc.tar.gz
gcc-fcd424cecbe8874404fc92520954ec806e7886fc.tar.bz2
Gimplify va_arg ap based on do_deref
2015-05-13 Tom de Vries <tom@codesourcery.com> PR tree-optimization/66010 * gimplify.h (gimplify_va_arg_internal): Remove declaration. * gimplify.c (gimplify_va_arg_internal): Remove and inline into ... * tree-stdarg.c (expand_ifn_va_arg_1): ... here. Choose between lval and rval based on do_deref. From-SVN: r223120
Diffstat (limited to 'gcc/tree-stdarg.c')
-rw-r--r--gcc/tree-stdarg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 3bede7e..f8ff70a 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -1059,7 +1059,14 @@ expand_ifn_va_arg_1 (function *fun)
push_gimplify_context (false);
- expr = gimplify_va_arg_internal (ap, type, &pre, &post);
+ /* Make it easier for the backends by protecting the valist argument
+ from multiple evaluations. */
+ if (do_deref == integer_one_node)
+ gimplify_expr (&ap, &pre, &post, is_gimple_min_lval, fb_lvalue);
+ else
+ gimplify_expr (&ap, &pre, &post, is_gimple_val, fb_rvalue);
+
+ expr = targetm.gimplify_va_arg_expr (ap, type, &pre, &post);
lhs = gimple_call_lhs (stmt);
if (lhs != NULL_TREE)