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 <rguent...@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" } } */