aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@linux.alibaba.com>2018-10-15 11:35:56 +0000
committerBin Cheng <amker@gcc.gnu.org>2018-10-15 11:35:56 +0000
commit0df7c778ed50095a0c4b266b4beb8b783de832a8 (patch)
treed04024259b2c9432259a627cb1a3c91d1045e794 /gcc/tree-loop-distribution.c
parent61e189a874392a296e46609502228019cae42e19 (diff)
downloadgcc-0df7c778ed50095a0c4b266b4beb8b783de832a8.zip
gcc-0df7c778ed50095a0c4b266b4beb8b783de832a8.tar.gz
gcc-0df7c778ed50095a0c4b266b4beb8b783de832a8.tar.bz2
re PR tree-optimization/87022 (miscompilation with -ftree-loop-distribution)
PR tree-optimization/87022 * tree-loop-distribution.c (pg_add_dependence_edges): Check all bits in dist vector rather than the first one. gcc/testsuite PR tree-optimization/87022 * gcc.dg/tree-ssa/pr87022.c: New test. From-SVN: r265161
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index d8db03b..1e8a9f0 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1921,7 +1921,8 @@ pg_add_dependence_edges (struct graph *rdg, int dir,
if (DDR_NUM_DIST_VECTS (ddr) != 1)
this_dir = 2;
/* If the overlap is exact preserve stmt order. */
- else if (lambda_vector_zerop (DDR_DIST_VECT (ddr, 0), 1))
+ else if (lambda_vector_zerop (DDR_DIST_VECT (ddr, 0),
+ DDR_NB_LOOPS (ddr)))
;
/* Else as the distance vector is lexicographic positive swap
the dependence direction. */