From: Jim Wilson Date: Thu, 10 Nov 2016 15:20:59 +0000 (+0000) Subject: Fix loop distribution bug with merging edges that creates too many edges. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd18c8c32a865a5432338d1959afefa42bebb718;p=gcc.git 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 --- 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;