diff options
author | Jeff Law <law@redhat.com> | 2013-09-17 11:27:41 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2013-09-17 11:27:41 -0600 |
commit | 8d34e421a5668e25a992bd0b349cb81e91ee3e49 (patch) | |
tree | 94bfe22f7d19095ab53bd28cb6fb75e78e2f9196 /gcc/tree-ssa-dom.c | |
parent | c152901f5e1082de4ede3bc98c7ede2dea361e8d (diff) | |
download | gcc-8d34e421a5668e25a992bd0b349cb81e91ee3e49.zip gcc-8d34e421a5668e25a992bd0b349cb81e91ee3e49.tar.gz gcc-8d34e421a5668e25a992bd0b349cb81e91ee3e49.tar.bz2 |
pr58387.c: New test.
* gcc.c-torture/execute/pr58387.c: New test.
* tree-ssa-dom.c (cprop_into_successor_phis): Also propagate
edge implied equivalences into successor phis.
* tree-ssa-threadupdate.c (phi_args_equal_on_edges): Moved into
here from tree-ssa-threadedge.c.
(mark_threaded_blocks): When threading through a joiner, if both
successors of the joiner's clone reach the same block, verify the
PHI arguments are equal. If not, cancel the jump threading request.
* tree-ssa-threadedge.c (phi_args_equal_on_edges): Moved into
tree-ssa-threadupdate.c
(thread_across_edge): Don't check PHI argument equality when
threading through joiner block here.
From-SVN: r202660
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index e02a566..4a2b48b 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1235,7 +1235,7 @@ record_equivalences_from_incoming_edge (basic_block bb) /* If the conversion widens the original value and the constant is in the range of the type of OLD_RHS, - then convert the constant and record the equivalence. + then convert the constant and record the equivalence. Note that int_fits_type_p does not check the precision if the upper and lower bounds are OK. */ @@ -1642,6 +1642,28 @@ cprop_into_successor_phis (basic_block bb) if (gsi_end_p (gsi)) continue; + /* We may have an equivalence associated with this edge. While + we can not propagate it into non-dominated blocks, we can + propagate them into PHIs in non-dominated blocks. */ + + /* Push the unwind marker so we can reset the const and copies + table back to its original state after processing this edge. */ + const_and_copies_stack.safe_push (NULL_TREE); + + /* Extract and record any simple NAME = VALUE equivalences. + + Don't bother with [01] = COND equivalences, they're not useful + here. */ + struct edge_info *edge_info = (struct edge_info *) e->aux; + if (edge_info) + { + tree lhs = edge_info->lhs; + tree rhs = edge_info->rhs; + + if (lhs && TREE_CODE (lhs) == SSA_NAME) + record_const_or_copy (lhs, rhs); + } + indx = e->dest_idx; for ( ; !gsi_end_p (gsi); gsi_next (&gsi)) { @@ -1667,6 +1689,8 @@ cprop_into_successor_phis (basic_block bb) && may_propagate_copy (orig_val, new_val)) propagate_value (orig_p, new_val); } + + restore_vars_to_original_value (); } } |