aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-loop-interchange.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-06-23 09:59:28 +0200
committerRichard Biener <rguenther@suse.de>2021-06-28 08:33:06 +0200
commit0ad9d88a3d7170b3d864693c9eb512f89a5096ff (patch)
tree6c2393b10b68add396899a6ce6383b8cb3423807 /gcc/gimple-loop-interchange.cc
parent3f1a08d9d731975d4061c306837ab28d52f37c7e (diff)
downloadgcc-0ad9d88a3d7170b3d864693c9eb512f89a5096ff.zip
gcc-0ad9d88a3d7170b3d864693c9eb512f89a5096ff.tar.gz
gcc-0ad9d88a3d7170b3d864693c9eb512f89a5096ff.tar.bz2
tree-optimization/101173 - fix interchange dependence checking
This adjusts the loop interchange dependence checking to disallow an outer loop dependence distance of zero. 2021-06-23 Richard Biener <rguenther@suse.de> PR tree-optimization/101173 * gimple-loop-interchange.cc (tree_loop_interchange::valid_data_dependences): Disallow outer loop dependence distance of zero. * gcc.dg/torture/pr101173.c: New testcase.
Diffstat (limited to 'gcc/gimple-loop-interchange.cc')
-rw-r--r--gcc/gimple-loop-interchange.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc
index 80f749b..43045c54 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -1043,8 +1043,8 @@ tree_loop_interchange::valid_data_dependences (unsigned i_idx, unsigned o_idx,
continue;
/* Be conservative, skip case if either direction at i_idx/o_idx
- levels is not '=' or '<'. */
- if (dist_vect[i_idx] < 0 || dist_vect[o_idx] < 0)
+ levels is not '=' (for the inner loop) or '<'. */
+ if (dist_vect[i_idx] < 0 || dist_vect[o_idx] <= 0)
return false;
}
}