libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-live-2.c
blob7c605d81c171455f1028593cba2d798803e48dd6
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_long } */
4 /* { dg-require-effective-target vect_shift } */
5 /* { dg-additional-options "-fno-tree-scev-cprop" } */
7 #include "tree-vect.h"
9 /* Statement used outside the loop.
10 NOTE: SCEV disabled to ensure the live operation is not removed before
11 vectorization. */
12 __attribute__ ((noinline)) int
13 liveloop (int start, int n, int *x, int *y)
15 int i = start;
16 int j;
17 int ret;
19 for (j = 0; j < n; ++j)
21 i += 1;
22 x[j] = i;
23 ret = y[j];
25 return ret;
28 #define MAX 97
29 #define START 13
31 int
32 main (void)
34 int a[MAX];
35 int b[MAX];
36 int i;
38 check_vect ();
40 for (i=0; i<MAX; i++)
42 __asm__ volatile ("");
43 b[i] = i;
46 int ret = liveloop (START, MAX, a, b);
48 if (ret != MAX - 1)
49 abort ();
51 #pragma GCC novector
52 for (i=0; i<MAX; i++)
54 __asm__ volatile ("");
55 if (a[i] != i+START+1)
56 abort ();
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
61 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant(?:(?!Analysis failed).)*Analysis succeeded" 1 "vect" } } */