diff options
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 633e326..c59e754 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4772,6 +4772,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, enum gimplify_status ret = GS_UNHANDLED; gimple assign; location_t loc = EXPR_LOCATION (*expr_p); + gimple_stmt_iterator gsi; gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR || TREE_CODE (*expr_p) == INIT_EXPR); @@ -4912,8 +4913,6 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, gimple_set_location (assign, EXPR_LOCATION (*expr_p)); } - gimplify_seq_add_stmt (pre_p, assign); - if (gimplify_ctxp->into_ssa && is_gimple_reg (*to_p)) { /* If we've somehow already got an SSA_NAME on the LHS, then @@ -4923,6 +4922,10 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, gimple_set_lhs (assign, *to_p); } + gimplify_seq_add_stmt (pre_p, assign); + gsi = gsi_last (*pre_p); + fold_stmt (&gsi); + if (want_value) { *expr_p = TREE_THIS_VOLATILE (*to_p) ? *from_p : unshare_expr (*to_p); |