Original got lost in the mail, resending.
-----------
gcc/testsuite/ChangeLog:
* gcc.dg/vect/vect-early-break_40.c: Fix.
* gcc.dg/vect/vect-uncounted-1.c: New.
* gcc.dg/vect/vect-uncounted-2.c: Likewise.
* gcc.dg/vect/vect-uncounted-3.c: Likewise.
* gcc.dg/vect/vect-uncounted-4.c: Likewise.
* gcc.dg/vect/vect-uncounted-run-1.c: Likewise.
---
.../gcc.dg/vect/vect-early-break_40.c | 3 +-
gcc/testsuite/gcc.dg/vect/vect-uncounted-1.c | 18 ++++++++
gcc/testsuite/gcc.dg/vect/vect-uncounted-2.c | 16 +++++++
gcc/testsuite/gcc.dg/vect/vect-uncounted-3.c | 26 ++++++++++++
gcc/testsuite/gcc.dg/vect/vect-uncounted-4.c | 17 ++++++++
.../gcc.dg/vect/vect-uncounted-run-1.c | 42 +++++++++++++++++++
6 files changed, 120 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/vect/vect-uncounted-1.c
create mode 100644 gcc/testsuite/gcc.dg/vect/vect-uncounted-2.c
create mode 100644 gcc/testsuite/gcc.dg/vect/vect-uncounted-3.c
create mode 100644 gcc/testsuite/gcc.dg/vect/vect-uncounted-4.c
create mode 100644 gcc/testsuite/gcc.dg/vect/vect-uncounted-run-1.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_40.c
b/gcc/testsuite/gcc.dg/vect/vect-early-break_40.c
index 428f6249fa6..9c0e1fb1264 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_40.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_40.c
@@ -23,5 +23,4 @@ unsigned test4(unsigned x)
return ret;
}
-/* SCEV can't currently analyze this loop bounds. */
-/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
{ xfail *-*-* } } } */
\ No newline at end of file
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-uncounted-1.c
b/gcc/testsuite/gcc.dg/vect/vect-uncounted-1.c
new file mode 100644
index 00000000000..8b0b4a815c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-uncounted-1.c
@@ -0,0 +1,18 @@
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int *haystack, int needle)
+{
+ int i = 0;
+ while (1)
+ {
+ if (haystack[i] == needle)
+ return i;
+ i++;
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-uncounted-2.c
b/gcc/testsuite/gcc.dg/vect/vect-uncounted-2.c
new file mode 100644
index 00000000000..90882bad50d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-uncounted-2.c
@@ -0,0 +1,16 @@
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int *a0, int *aN, int *b0, int *bN)
+{
+ int *a = a0;
+ int *b = b0;
+
+ for (;a != aN && b != bN; a++, b++)
+ *a += *b;
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-uncounted-3.c
b/gcc/testsuite/gcc.dg/vect/vect-uncounted-3.c
new file mode 100644
index 00000000000..3e7d7f1e152
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-uncounted-3.c
@@ -0,0 +1,26 @@
+/* Test the correct resetting of live out values on epilog loop entry
for IV
+ when it's incremented prior to exit taken. */
+/* { dg-add-options vect_early_break } */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+extern int N;
+
+int
+foo (int c[N], int d[N], int a)
+{
+ int i = 0;
+ while(c[i] != 0)
+ {
+ i += 1;
+ if (d[i] == a)
+ break;
+ if (d[i] == 7)
+ break;
+ }
+ return i;
+}
+
+/* { dg-final { scan-tree-dump "BIT_FIELD_REF <vect_vec_iv_.\[0-9_\]+,
\[0-9\]+, 0>" "vect" } } */
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-uncounted-4.c
b/gcc/testsuite/gcc.dg/vect/vect-uncounted-4.c
new file mode 100644
index 00000000000..22af370d595
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-uncounted-4.c
@@ -0,0 +1,17 @@
+/* Check vectorization of uncounted reductions. */
+/* { dg-do compile } */
+
+int
+foo (int *a0, int *aN, int accum)
+{
+ int i = 0;
+ while (1)
+ {
+ if (a0[i++] == *aN)
+ return accum;
+ accum += a0[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump "Detected reduction." "vect" } } */
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-uncounted-run-1.c
b/gcc/testsuite/gcc.dg/vect/vect-uncounted-run-1.c
new file mode 100644
index 00000000000..eb734e13ef0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-uncounted-run-1.c
@@ -0,0 +1,42 @@
+/* execution test for the correct resetting of live out values on
epilog loop
+ entry.
+ Strategy:
+ 1. Scan the vector dump ensuring we actually vectorized the loop.
+ 2. If we have a vectorzied loop, ensure it executes as expected.
+*/
+/* { dg-add-options vect_early_break } */
+/* { dg-do run } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+#include <assert.h>
+#define N 9
+void
+test01 ()
+{
+ {
+ int x[N] = {2, 4, 6, 8, 10, 12, 14, 16, 18};
+ const int y[N] = {3, 5, 7, 9, 11, 13, 15, 17, 19};
+ int z[N] = {5, 9, 13, 17, 21, 25, 29, 33, 37};
+
+ int *x0 = x;
+ int *xN = x+N;
+ const int *y0 = y;
+ const int *yN = y+N;
+
+ int *res = x;
+
+ for (; x0 != xN && y0 != yN; ++x0, (void)++y0, ++res)
+ *res = *x0 + *y0;
+ assert (x0 == x+N && y0 == y+N && res == x+N);
+ assert (x[0] == z[0] && x[1] == z[1]);
+ }
+}
+
+int
+main ()
+{
+ test01 ();
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect"
} } */
--
2.43.0