diff options
author | Michael Matz <matz@suse.de> | 2012-06-15 14:40:38 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2012-06-15 14:40:38 +0000 |
commit | 6da8be895c345e90cec9a70fdeb38111fc48a880 (patch) | |
tree | 97534b2183367e8929d27bfc21c1ffdec14eb2a6 /gcc/gimplify.c | |
parent | ef5ad3b74564ef8039552d4d4e8098569fef3355 (diff) | |
download | gcc-6da8be895c345e90cec9a70fdeb38111fc48a880.zip gcc-6da8be895c345e90cec9a70fdeb38111fc48a880.tar.gz gcc-6da8be895c345e90cec9a70fdeb38111fc48a880.tar.bz2 |
gimplify.c (gimplify_modify_expr): Fold generated statements.
* gimplify.c (gimplify_modify_expr): Fold generated statements.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Check flag_ltrans.
testsuite/
* gcc.dg/debug/dwarf2/inline3.c: Adjust.
* gcc.dg/tree-ssa/foldstring-1.c: Adjust.
From-SVN: r188664
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); |