From: Jeff Law Date: Tue, 19 Nov 2013 03:30:08 +0000 (-0700) Subject: tree-ssa-threadupdate.c (thread_through_loop_header): Do not thread through a joiner... X-Git-Tag: releases/gcc-4.9.0~2669 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01ccc98e191bfa1e2a95338d1536f048f66204ef;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14ed90f9a537..841fd6c19b55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-11-19 Jeff Law + + * tree-ssa-threadupdate.c (thread_through_loop_header): Do not + thread through a joiner which has the latch edge. + 2013-11-19 Jan Hubicka * md.texi (setmem): Document new parameter. diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 97dc6cbce34a..bc23f4c1fea5 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 *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 *path = THREAD_PATH (latch); tgt_edge = (*path)[1]->e; tgt_bb = tgt_edge->dest; }