Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-live-5.c
blob7cde1db534bb1201e106ba34c9e8716c1f0445a1
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fno-tree-scev-cprop" } */
4 #include "tree-vect.h"
6 /* Statement that is simple and invariant used outside the loop.
7 NOTE: SCEV disabled to ensure the live operation is not removed before
8 vectorization. */
9 __attribute__ ((noinline)) int
10 liveloop (int start, int n, int *x, int *y)
12 int i = start;
13 int j;
14 int ret;
16 for (j = 0; j < n; ++j)
18 i += 1;
19 ret = y[0];
20 x[j] = i + ret;
22 return ret;
25 #define MAX 77
26 #define START 37
28 int
29 main (void)
31 int a[MAX];
32 int b = 99;
33 int i;
35 check_vect ();
37 int ret = liveloop (START, MAX, a, &b);
39 if (ret != 99)
40 abort ();
42 for (i=0; i<MAX; i++)
44 __asm__ volatile ("");
45 if (a[i] != i+START+100)
46 abort ();
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
51 /* { dg-final { scan-tree-dump-not "vec_stmt_relevant_p: stmt live but not relevant" "vect" } } */