re PR tree-optimization/68417 (Missed vectorization opportunity when setting struct...
authorRichard Biener <rguenther@suse.de>
Wed, 9 Dec 2015 12:29:19 +0000 (12:29 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 9 Dec 2015 12:29:19 +0000 (12:29 +0000)
2015-12-09  Richard Biener  <rguenther@suse.de>

PR tree-optimization/68417
* gcc.dg/vect/pr68417.c: New testcase.

From-SVN: r231452

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr68417.c [new file with mode: 0644]

index 1b017b760127e567df9912a001e04e1471c00e82..d5226ef013dd8831347a8c9b2b37171c4f759eea 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-09  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68417
+       * gcc.dg/vect/pr68417.c: New testcase.
+
 2015-12-09  Martin Liska  <mliska@suse.cz>
 
        * gcc.dg/ipa/pr68790.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/pr68417.c b/gcc/testsuite/gcc.dg/vect/pr68417.c
new file mode 100644 (file)
index 0000000..bddd9f9
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_condition } */
+
+#define N 16
+
+typedef struct {
+  int x;
+  int y;
+} Point;
+
+void
+foo(Point *p1, Point *p2, Point *p3, int *data)
+{
+  int m, m1, m2;
+  int i;
+
+  for (i = 0; i < N; i++) {
+    m = *data++;
+
+    m1 = p1->x - m;
+    m2 = p2->x + m;
+
+    p3->y = (m1 >= m2) ? p1->y : p2->y;
+
+    p1++;
+    p2++;
+    p3++;
+  }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */