This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR68583
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 9 Dec 2015 13:28:11 +0100 (CET)
- Subject: Re: [PATCH] Fix PR68583
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1512090930530 dot 4884 at t29 dot fhfr dot qr>
On Wed, 9 Dec 2015, Richard Biener wrote:
>
> Well, not really in the end - the actual testcase would need code
> hoisting to make the refs equal enough for ifcvt. Making the testcase
> simpler doesn't seem to capture the issue so for now without one
> (I'll keep trying).
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
This fixed PR68417, I committed the testcase below.
Richard.
2015-12-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/68417
* gcc.dg/vect/pr68417.c: New testcase.
Index: gcc/testsuite/gcc.dg/vect/pr68417.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr68417.c (revision 0)
+++ gcc/testsuite/gcc.dg/vect/pr68417.c (working copy)
@@ -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" } } */