Debian Codegraph @

gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-5.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,x;
14
15 for (i = 0; i < N; i++) {
16 sum = 0;
17 x = a[i];
18 for (j = 0; j < N; j++) {
19 sum += (x + j);
20 }
21 a[i] = sum + i + x;
22 }
23 }
24
25 int main (void)
26 {
27 int i,j;
28 int sum;
29 int aa[N];
30
31 check_vect ();
32
33 for (i=0; i<N; i++){
34 a[i] = i;
35 aa[i] = i;
36 }
37
38 foo ();
39
40 /* check results: */
41 #pragma GCC novector
42 for (i=0; i<N; i++)
43 {
44 sum = 0;
45 for (j = 0; j < N; j++)
46 sum += (j + aa[i]);
47 if (a[i] != sum + i + aa[i])
48 abort();
49 }
50
51 return 0;
52 }
53
54 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */