Debian Codegraph @

gcc/testsuite/gcc.dg/vect/no-scevccp-outer-3.c

raw
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 40
7
8 int a[N];
9
10 __attribute__ ((noinline)) int
11 foo (){
12 int i,j;
13 int sum;
14
15 /* inner-loop step > 1 */
16 for (i = 0; i < N; i++) {
17 sum = 0;
18 for (j = 0; j < N; j+=2) {
19 sum += j;
20 }
21 a[i] = sum;
22 }
23 }
24
25 int main (void)
26 {
27 int i,j;
28 int sum;
29
30 check_vect ();
31
32 for (i=0; i<N; i++)
33 a[i] = i;
34
35 foo ();
36
37 /* check results: */
38 #pragma GCC novector
39 for (i=0; i<N; i++)
40 {
41 sum = 0;
42 for (j = 0; j < N; j+=2)
43 sum += j;
44 if (a[i] != sum)
45 abort();
46 }
47
48 return 0;
49 }
50
51 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */