summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-14 18:05:55 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-14 18:05:55 +0000
commit85309e9def188cf12b40c9ff20223652b3cc656a (patch)
treefc67e2a30d6bb3fbe6b464c62beebc44c84cfea4 /gcc/tree-ssa-threadedge.c
parent3b1199de386e96a0de40a2a49bcfb054c95990c9 (diff)
downloadgcc-85309e9def188cf12b40c9ff20223652b3cc656a.tar.gz
* tree-ssa-threadedge.c (thread_through_normal_block): Only push
the EDGE_START_JUMP_THREAD marker if the jump threading path is empty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r--gcc/tree-ssa-threadedge.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index c9b2c697d88..cabfc824c62 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -940,12 +940,18 @@ thread_through_normal_block (edge e,
|| bitmap_bit_p (visited, dest->index))
return false;
- jump_thread_edge *x
- = new jump_thread_edge (e, EDGE_START_JUMP_THREAD);
- path->safe_push (x);
- *backedge_seen_p |= ((e->flags & EDGE_DFS_BACK) != 0);
+ /* Only push the EDGE_START_JUMP_THREAD marker if this is
+ first edge on the path. */
+ if (path->length () == 0)
+ {
+ jump_thread_edge *x
+ = new jump_thread_edge (e, EDGE_START_JUMP_THREAD);
+ path->safe_push (x);
+ *backedge_seen_p |= ((e->flags & EDGE_DFS_BACK) != 0);
+ }
- x = new jump_thread_edge (taken_edge, EDGE_COPY_SRC_BLOCK);
+ jump_thread_edge *x
+ = new jump_thread_edge (taken_edge, EDGE_COPY_SRC_BLOCK);
path->safe_push (x);
*backedge_seen_p |= ((taken_edge->flags & EDGE_DFS_BACK) != 0);
@@ -953,7 +959,7 @@ thread_through_normal_block (edge e,
secondary effects of threading without having to re-run DOM or
VRP. */
if (!*backedge_seen_p
- || ! cond_arg_set_in_bb (taken_edge, e->dest))
+ || ! cond_arg_set_in_bb (taken_edge, e->dest))
{
/* We don't want to thread back to a block we have already
visited. This may be overly conservative. */