aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2013-09-17 11:27:41 -0600
committerJeff Law <law@gcc.gnu.org>2013-09-17 11:27:41 -0600
commit8d34e421a5668e25a992bd0b349cb81e91ee3e49 (patch)
tree94bfe22f7d19095ab53bd28cb6fb75e78e2f9196 /gcc/tree-ssa-threadedge.c
parentc152901f5e1082de4ede3bc98c7ede2dea361e8d (diff)
downloadgcc-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-threadedge.c')
-rw-r--r--gcc/tree-ssa-threadedge.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 42474f1..47db280 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -841,28 +841,6 @@ thread_around_empty_blocks (edge taken_edge,
return false;
}
-/* E1 and E2 are edges into the same basic block. Return TRUE if the
- PHI arguments associated with those edges are equal or there are no
- PHI arguments, otherwise return FALSE. */
-
-static bool
-phi_args_equal_on_edges (edge e1, edge e2)
-{
- gimple_stmt_iterator gsi;
- int indx1 = e1->dest_idx;
- int indx2 = e2->dest_idx;
-
- for (gsi = gsi_start_phis (e1->dest); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple phi = gsi_stmt (gsi);
-
- if (!operand_equal_p (gimple_phi_arg_def (phi, indx1),
- gimple_phi_arg_def (phi, indx2), 0))
- return false;
- }
- return true;
-}
-
/* We are exiting E->src, see if E->dest ends with a conditional
jump which has a known value when reached via E.
@@ -1021,18 +999,9 @@ thread_across_edge (gimple dummy_cond,
record the jump threading opportunity. */
if (found)
{
- edge tmp;
- /* If there is already an edge from the block to be duplicated
- (E2->src) to the final target (E3->dest), then make sure that
- the PHI args associated with the edges E2 and E3 are the
- same. */
- tmp = find_edge (taken_edge->src, path[path.length () - 1]->dest);
- if (!tmp || phi_args_equal_on_edges (tmp, path[path.length () - 1]))
- {
- propagate_threaded_block_debug_into (path[path.length () - 1]->dest,
- taken_edge->dest);
- register_jump_thread (path, true);
- }
+ propagate_threaded_block_debug_into (path[path.length () - 1]->dest,
+ taken_edge->dest);
+ register_jump_thread (path, true);
}
path.release();