From: Richard Biener Date: Wed, 7 Jul 2021 11:46:48 +0000 (+0200) Subject: tree-optimization/34195 - testcase for fixed vectorization X-Git-Tag: basepoints/gcc-13~6215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=005f31a0370cf35e332db9415a0ff538320bcddc;p=thirdparty%2Fgcc.git tree-optimization/34195 - testcase for fixed vectorization This adds a testcase for an old fixed PR. 2021-07-07 Richard Biener PR tree-optimization/34195 * gcc.dg/vect/pr34195.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/vect/pr34195.c b/gcc/testsuite/gcc.dg/vect/pr34195.c new file mode 100644 index 000000000000..e36950ba4295 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr34195.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ + +#define M 11 + +struct S +{ + float x; + float y; +} pS[100]; + +float a[1000]; +float b[1000]; + +void +foo (int n) +{ + int i, j; + + for (i = 0; i < n; i++) + { + pS[i].x = 0; + pS[i].y = 0; + + for (j = 0; j < M; j++) + { + pS[i].x += (a[i]+b[i]); + pS[i].y += (a[i]-b[i]); + } + } +} + +/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" } } */