diff options
author | Jeff Law <law@redhat.com> | 2013-11-18 20:30:08 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2013-11-18 20:30:08 -0700 |
commit | 01ccc98e191bfa1e2a95338d1536f048f66204ef (patch) | |
tree | 1d7b604c35241548da67f6bd944bc34fdf344eda /gcc/tree-ssa-threadupdate.c | |
parent | 41674b9fe4c0beb00ac29c32a2085fa670e863a9 (diff) | |
download | gcc-01ccc98e191bfa1e2a95338d1536f048f66204ef.zip gcc-01ccc98e191bfa1e2a95338d1536f048f66204ef.tar.gz gcc-01ccc98e191bfa1e2a95338d1536f048f66204ef.tar.bz2 |
tree-ssa-threadupdate.c (thread_through_loop_header): Do not thread through a joiner which has the latch edge.
* tree-ssa-threadupdate.c (thread_through_loop_header): Do not
thread through a joiner which has the latch edge.
From-SVN: r205003
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 97dc6cb..bc23f4c 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -1060,11 +1060,22 @@ thread_through_loop_header (struct loop *loop, bool may_peel_loop_headers) if (single_succ_p (header)) goto fail; + /* If we threaded the latch using a joiner block, we cancel the + threading opportunity out of an abundance of caution. However, + still allow threading from outside to inside the loop. */ if (latch->aux) { vec<jump_thread_edge *> *path = THREAD_PATH (latch); if ((*path)[1]->type == EDGE_COPY_SRC_JOINER_BLOCK) - goto fail; + { + delete_jump_thread_path (path); + latch->aux = NULL; + } + } + + if (latch->aux) + { + vec<jump_thread_edge *> *path = THREAD_PATH (latch); tgt_edge = (*path)[1]->e; tgt_bb = tgt_edge->dest; } |