aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/cp/cp-gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/cp/cp-gimplify.c')
-rw-r--r--gcc-4.9/gcc/cp/cp-gimplify.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/cp/cp-gimplify.c b/gcc-4.9/gcc/cp/cp-gimplify.c
index ef4b04372..3dc32e6cf 100644
--- a/gcc-4.9/gcc/cp/cp-gimplify.c
+++ b/gcc-4.9/gcc/cp/cp-gimplify.c
@@ -723,6 +723,27 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
&& !seen_error ())
return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
+ /* DR 1030 says that we need to evaluate the elements of an
+ initializer-list in forward order even when it's used as arguments to
+ a constructor. So if the target wants to evaluate them in reverse
+ order and there's more than one argument other than 'this', gimplify
+ them in order. */
+ ret = GS_OK;
+ if (PUSH_ARGS_REVERSED && CALL_EXPR_LIST_INIT_P (*expr_p)
+ && call_expr_nargs (*expr_p) > 2)
+ {
+ int nargs = call_expr_nargs (*expr_p);
+ location_t loc = EXPR_LOC_OR_LOC (*expr_p, input_location);
+ for (int i = 1; i < nargs; ++i)
+ {
+ enum gimplify_status t
+ = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p, loc);
+ if (t == GS_ERROR)
+ ret = GS_ERROR;
+ }
+ }
+ break;
+
default:
ret = (enum gimplify_status) c_gimplify_expr (expr_p, pre_p, post_p);
break;
@@ -1578,7 +1599,7 @@ cxx_omp_predetermined_sharing (tree decl)
/* Finalize an implicitly determined clause. */
void
-cxx_omp_finish_clause (tree c)
+cxx_omp_finish_clause (tree c, gimple_seq *)
{
tree decl, inner_type;
bool make_shared = false;