cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-outer-slp-3.c
blobd315db5632ba6764d0cf23cdedec2e7b6db01ab2
1 /* { dg-require-effective-target vect_double } */
2 /* { dg-require-effective-target vect_intdouble_cvt } */
4 #include "tree-vect.h"
6 double image[40];
8 void __attribute__((noipa))
9 foo (void)
11 for (int i = 0; i < 20; i++)
13 double suma = 0;
14 double sumb = 0;
15 int k = image[2*i];
16 int l = image[2*i+1];
17 for (int j = 0; j < 40; j++)
19 suma += k+i;
20 sumb += l+i;
21 k++;
22 l++;
24 image[2*i] = suma;
25 image[2*i+1] = sumb;
29 int main ()
31 check_vect ();
33 #pragma GCC novector
34 for (int i = 0; i < 40; ++i)
35 image[i] = 1.;
37 foo ();
39 #pragma GCC novector
40 for (int i = 0; i < 20; i++)
42 double suma = 0;
43 double sumb = 0;
44 int k = 1;
45 int l = 1;
46 for (int j = 0; j < 40; j++)
48 suma += k+i;
49 sumb += l+i;
50 asm ("" : "+g" (suma));
51 asm ("" : "+g" (sumb));
52 k++;
53 l++;
55 if (image[2*i] != suma
56 || image[2*i+1] != sumb)
57 abort ();
60 return 0;
63 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
64 /* We don't yet support SLP inductions for variable length vectors. */
65 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_variable_length } } } */