aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-05-20 08:16:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-05-20 08:16:13 +0000
commitd1c0308e9b0f99d008b1aad2f955d1a423715a81 (patch)
tree64cca862e3e1fdc3c2795649bc8b94442a0f1313 /gcc/tree-ssa-pre.c
parent54da09ee2062f41141dbfd116975ee20509a96e3 (diff)
downloadgcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.zip
gcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.tar.gz
gcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.tar.bz2
re PR tree-optimization/61221 (ICE on valid code at -O1 and above on x86_64-linux-gnu)
2014-05-20 Richard Biener <rguenther@suse.de> PR tree-optimization/61221 * tree-ssa-pre.c (el_to_update): Remove. (eliminate_dom_walker::before_dom_children): Handle released VDEFs by value-numbering them to the associated VUSE. Update stmt immediately for substituted call address. (eliminate): Remove delayed stmt updating code. * tree-ssa-sccvn.c (vuse_ssa_val): New function valueizing possibly late re-numbered vuses. (vn_reference_lookup_2): Adjust. (vn_reference_lookup_pieces): Likewise. (vn_reference_lookup): Likewise. From-SVN: r210633
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r--gcc/tree-ssa-pre.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index e487d28..2929d4d 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3915,7 +3915,6 @@ compute_avail (void)
/* Local state for the eliminate domwalk. */
static vec<gimple> el_to_remove;
-static vec<gimple> el_to_update;
static unsigned int el_todo;
static vec<tree> el_avail;
static vec<tree> el_avail_stack;
@@ -4155,9 +4154,14 @@ eliminate_dom_walker::before_dom_children (basic_block b)
print_gimple_stmt (dump_file, stmt, 0, 0);
}
pre_stats.eliminations++;
+
+ tree vdef = gimple_vdef (stmt);
+ tree vuse = gimple_vuse (stmt);
propagate_tree_value_into_stmt (&gsi, sprime);
stmt = gsi_stmt (gsi);
update_stmt (stmt);
+ if (vdef != gimple_vdef (stmt))
+ VN_INFO (vdef)->valnum = vuse;
/* If we removed EH side-effects from the statement, clean
its EH information. */
@@ -4255,9 +4259,14 @@ eliminate_dom_walker::before_dom_children (basic_block b)
sprime = fold_convert (gimple_expr_type (stmt), sprime);
pre_stats.eliminations++;
+
+ tree vdef = gimple_vdef (stmt);
+ tree vuse = gimple_vuse (stmt);
propagate_tree_value_into_stmt (&gsi, sprime);
stmt = gsi_stmt (gsi);
update_stmt (stmt);
+ if (vdef != gimple_vdef (stmt))
+ VN_INFO (vdef)->valnum = vuse;
/* If we removed EH side-effects from the statement, clean
its EH information. */
@@ -4371,7 +4380,11 @@ eliminate_dom_walker::before_dom_children (basic_block b)
}
gimple_call_set_fn (stmt, fn);
- el_to_update.safe_push (stmt);
+ tree vdef = gimple_vdef (stmt);
+ tree vuse = gimple_vuse (stmt);
+ update_stmt (stmt);
+ if (vdef != gimple_vdef (stmt))
+ VN_INFO (vdef)->valnum = vuse;
/* When changing a call into a noreturn call, cfg cleanup
is needed to fix up the noreturn call. */
@@ -4430,7 +4443,6 @@ eliminate (void)
need_ab_cleanup = BITMAP_ALLOC (NULL);
el_to_remove.create (0);
- el_to_update.create (0);
el_todo = 0;
el_avail.create (0);
el_avail_stack.create (0);
@@ -4482,13 +4494,6 @@ eliminate (void)
}
el_to_remove.release ();
- /* We cannot update call statements with virtual operands during
- SSA walk. This might remove them which in turn makes our
- VN lattice invalid. */
- FOR_EACH_VEC_ELT (el_to_update, i, stmt)
- update_stmt (stmt);
- el_to_update.release ();
-
return el_todo;
}