aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-stdarg.c
diff options
context:
space:
mode:
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)