From dd18c8c32a865a5432338d1959afefa42bebb718 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 10 Nov 2016 15:20:59 +0000 Subject: [PATCH] Fix loop distribution bug with merging edges that creates too many edges. gcc/ * tree-loop-distribution.c (pg_add_dependence_edges): Return 2 if this_dir is 2. Check for this_dir non-zero before dir != this_dir check. From-SVN: r242038 --- gcc/ChangeLog | 6 ++++++ gcc/tree-loop-distribution.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e93f793453..1e13f598d6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-10 Jim Wilson + + * tree-loop-distribution.c (pg_add_dependence_edges): Return 2 if + this_dir is 2. Check for this_dir non-zero before dir != this_dir + check. + 2016-11-10 Jakub Jelinek * omp-low.c (lower_omp_target): Fix up argument to is_reference. diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 5580f286ccf..902cf30b78a 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1408,9 +1408,11 @@ pg_add_dependence_edges (struct graph *rdg, vec loops, int dir, else this_dir = 0; free_dependence_relation (ddr); - if (dir == 0) + if (this_dir == 2) + return 2; + else if (dir == 0) dir = this_dir; - else if (dir != this_dir) + else if (this_dir != 0 && dir != this_dir) return 2; /* Shuffle "back" dr1. */ dr1 = saved_dr1; -- 2.30.2