IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-22.c
blobac24b05d0a41574b1ac9c481ff85ee31fe6cc88f
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 int a[N];
10 __attribute__ ((noinline)) int
11 foo (int n){
12 int i,j;
13 int sum;
15 if (n<=0)
16 return 0;
18 /* inner-loop index j used after the inner-loop */
19 for (i = 0; i < N; i++) {
20 sum = 0;
21 for (j = 0; j < n; j+=2) {
22 sum += j;
24 a[i] = sum + j;
28 int main (void)
30 int i,j;
31 int sum;
33 check_vect ();
35 for (i=0; i<N; i++)
36 a[i] = i;
38 foo (N);
40 /* check results: */
41 for (i=0; i<N; i++)
43 sum = 0;
44 for (j = 0; j < N; j+=2)
45 sum += j;
46 if (a[i] != sum + j)
47 abort();
50 return 0;
53 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
54 /* { dg-final { cleanup-tree-dump "vect" } } */