summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-08-05 10:40:18 +0200
committerRichard Biener <rguenther@suse.de>2022-08-05 12:11:46 +0200
commit36bc2a8f24f9c8f6eb2c579d520d7fc73a113ae1 (patch)
tree9df777dd4518ab61df96e08efaa83efdb706e48b /gcc/testsuite
parent4574dad43f77100f401375e6c9df6402e99ab682 (diff)
tree-optimization/106533 - loop distribution of inner loop of nestlinaro-local/ci/tcwg_kernel/gnu-master-aarch64-norov-defconfig
Loop distribution currently gives up if the outer loop of a loop nest it analyzes contains a stmt with side-effects instead of continuing to analyze the innermost loop. The following fixes that by continuing anyway. PR tree-optimization/106533 * tree-loop-distribution.cc (loop_distribution::execute): Continue analyzing the inner loops when find_seed_stmts_for_distribution fails. * gcc.dg/tree-ssa/ldist-39.c: New testcase.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ldist-39.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-39.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-39.c
new file mode 100644
index 00000000000..3ef72864d96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-39.c
@@ -0,0 +1,16 @@
+/* PR/106533 */
+/* { dg-options "-O2 -fdump-tree-ldist-optimized" } */
+
+void bar (int *a, int * __restrict b)
+{
+ for (int k = 0; k < 10; k++)
+ {
+ for (int j = 0; j < 100000; ++j)
+ a[j] = b[j];
+ __builtin_printf ("Foo!");
+ }
+}
+
+/* The stmt with side-effects in the outer loop should not prevent
+ distribution of the inner loop of the loop nest. */
+/* { dg-final { scan-tree-dump "optimized: Loop . distributed: split to 0 loops and 1 library calls" "ldist" } } */