aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-09-04 09:28:58 +0000
committerRichard Guenther <rguenther@suse.de>2012-09-04 09:28:58 +0000
commitf8b618a4fa681fe66625d775d65d9ea8442d6d4c (patch)
treefa175b9596e8734f22e4875c7fe68cff105f80e9 /gcc/tree-ssa-threadupdate.c
parent6cbaf6d2a1b83c1c3c5657ec92afbd69e45bc219 (diff)
2012-09-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54458 * tree-ssa-threadupdate.c (thread_through_loop_header): If we turn the loop into one with multiple latches mark it so. * gcc.dg/torture/pr54458.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190918 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 86ad74f1bc8..30336a18e81 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -1037,11 +1037,21 @@ thread_through_loop_header (struct loop *loop, bool may_peel_loop_headers)
}
free (bblocks);
+ /* If the new header has multiple latches mark it so. */
+ FOR_EACH_EDGE (e, ei, loop->header->preds)
+ if (e->src->loop_father == loop
+ && e->src != loop->latch)
+ {
+ loop->latch = NULL;
+ loops_state_set (LOOPS_MAY_HAVE_MULTIPLE_LATCHES);
+ }
+
/* Cancel remaining threading requests that would make the
loop a multiple entry loop. */
FOR_EACH_EDGE (e, ei, header->preds)
{
edge e2;
+
if (e->aux == NULL)
continue;