111
|
1 /* { dg-require-effective-target vect_long } */
|
|
2 /* { dg-require-effective-target vect_shift } */
|
|
3 /* { dg-additional-options "-fno-tree-scev-cprop" } */
|
|
4
|
|
5 #include "tree-vect.h"
|
|
6
|
|
7 /* Statement used outside the loop.
|
|
8 NOTE: SCEV disabled to ensure the live operation is not removed before
|
|
9 vectorization. */
|
|
10 __attribute__ ((noinline)) int
|
|
11 liveloop (int start, int n, int *x, int *y)
|
|
12 {
|
|
13 int i = start;
|
|
14 int j;
|
|
15 int ret;
|
|
16
|
|
17 for (j = 0; j < n; ++j)
|
|
18 {
|
|
19 i += 1;
|
|
20 x[j] = i;
|
|
21 ret = y[j];
|
|
22 }
|
|
23 return ret;
|
|
24 }
|
|
25
|
|
26 #define MAX 97
|
|
27 #define START 13
|
|
28
|
|
29 int
|
|
30 main (void)
|
|
31 {
|
|
32 int a[MAX];
|
|
33 int b[MAX];
|
|
34 int i;
|
|
35
|
|
36 check_vect ();
|
|
37
|
|
38 for (i=0; i<MAX; i++)
|
|
39 {
|
|
40 __asm__ volatile ("");
|
|
41 b[i] = i;
|
|
42 }
|
|
43
|
|
44 int ret = liveloop (START, MAX, a, b);
|
|
45
|
|
46 if (ret != MAX - 1)
|
|
47 abort ();
|
|
48
|
|
49 for (i=0; i<MAX; i++)
|
|
50 {
|
|
51 __asm__ volatile ("");
|
|
52 if (a[i] != i+START+1)
|
|
53 abort ();
|
|
54 }
|
|
55 }
|
|
56
|
|
57 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|
|
58 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 1 "vect" } } */
|