aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-22 08:14:21 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-22 08:14:21 +0000
commit85d5b033ae83c37ae0b4dbd4210d463dcacc4842 (patch)
treef17eed995a01ddf176e38c4953060a684f97d187
parent8dc877ebc405937c7026f8fa7632b23e1f6ebccb (diff)
downloadgcc-85d5b033ae83c37ae0b4dbd4210d463dcacc4842.zip
gcc-85d5b033ae83c37ae0b4dbd4210d463dcacc4842.tar.gz
gcc-85d5b033ae83c37ae0b4dbd4210d463dcacc4842.tar.bz2
pr65947-14.c: New testcase.
2017-06-22 Richard Biener <rguenther@suse.de> * gcc.dg/vect/pr65947-14.c: New testcase. From-SVN: r249500
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr65947-14.c44
2 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa14c61..907e176 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-06-22 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/pr65947-14.c: New testcase.
+
2017-06-21 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/80510
diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-14.c b/gcc/testsuite/gcc.dg/vect/pr65947-14.c
new file mode 100644
index 0000000..2b15707
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr65947-14.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+extern void abort (void) __attribute__ ((noreturn));
+
+#define N 27
+
+/* Condition reduction with matches only in even lanes at runtime. */
+
+int
+condition_reduction (int *a, int min_v)
+{
+ int last = N + 96;
+
+ for (int i = 0; i < N; i++)
+ if (a[i] > min_v)
+ last = i;
+
+ return last;
+}
+
+int
+main (void)
+{
+ int a[N] = {
+ 47, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 21, 22, 23, 24, 25, 26, 27
+ };
+
+ check_vect ();
+
+ int ret = condition_reduction (a, 46);
+
+ /* loop should have found a value of 0, not default N + 96. */
+ if (ret != 0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" { xfail { ! vect_max_reduc } } } */
+/* { dg-final { scan-tree-dump-times "condition expression based on integer induction." 4 "vect" } } */