aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-11-17 14:47:07 +0100
committerRichard Biener <rguenther@suse.de>2023-11-17 14:48:36 +0100
commit1f28b2e4d8f8ea54848c332c707fa4ca5f028fa1 (patch)
tree474c67b0a9d4f621d5405b39192347a5d5850ea6 /gcc
parentb9eba3baf54b4fc25c3006768bb945058622658b (diff)
downloadgcc-1f28b2e4d8f8ea54848c332c707fa4ca5f028fa1.zip
gcc-1f28b2e4d8f8ea54848c332c707fa4ca5f028fa1.tar.gz
gcc-1f28b2e4d8f8ea54848c332c707fa4ca5f028fa1.tar.bz2
Revert "tree-optimization/112281 - loop distribution and zero dependence distances"
This reverts commit 5ea2965b499f9e491e45db19fedbccfccb75076a.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr112281.c19
-rw-r--r--gcc/tree-loop-distribution.cc7
2 files changed, 3 insertions, 23 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr112281.c b/gcc/testsuite/gcc.dg/torture/pr112281.c
deleted file mode 100644
index 3f0a61a..0000000
--- a/gcc/testsuite/gcc.dg/torture/pr112281.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do run } */
-/* { dg-additional-options "-ftree-loop-distribution" } */
-
-struct {
- int : 8;
- int a;
-} b, d[4] = {{0}, {0}, {0}, {5}};
-int c, e;
-int main()
-{
- for (c = 2; c; c--)
- for (e = 0; e < 2; e++) {
- d[c] = b = d[c + 1];
- d[c + 1].a = 0;
- }
- if (b.a != 0)
- __builtin_abort();
- return 0;
-}
diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc
index 5ededd9..ffca535 100644
--- a/gcc/tree-loop-distribution.cc
+++ b/gcc/tree-loop-distribution.cc
@@ -2163,10 +2163,9 @@ loop_distribution::pg_add_dependence_edges (struct graph *rdg, int dir,
gcc.dg/tree-ssa/pr94969.c. */
if (DDR_NUM_DIST_VECTS (ddr) != 1)
this_dir = 2;
- /* If the dependence distance is zero in the innermost
- loop preserve stmt order. */
- else if (DDR_DIST_VECT (ddr, 0)
- [DDR_LOOP_NEST (ddr).length () - 1] == 0)
+ /* If the overlap is exact preserve stmt order. */
+ 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. */