From: Richard Biener Date: Wed, 9 Dec 2015 12:29:19 +0000 (+0000) Subject: re PR tree-optimization/68417 (Missed vectorization opportunity when setting struct... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=030809830af91bc325684493fa103b6ae3bf2369;p=gcc.git re PR tree-optimization/68417 (Missed vectorization opportunity when setting struct field) 2015-12-09 Richard Biener PR tree-optimization/68417 * gcc.dg/vect/pr68417.c: New testcase. From-SVN: r231452 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1b017b76012..d5226ef013d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-09 Richard Biener + + PR tree-optimization/68417 + * gcc.dg/vect/pr68417.c: New testcase. + 2015-12-09 Martin Liska * 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 index 00000000000..bddd9f909a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr68417.c @@ -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" } } */