Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr59591-2.c

raw
1 /* PR tree-optimization/59591 */
2 /* { dg-additional-options "-fopenmp-simd" } */
3
4 #ifndef CHECK_H
5 #include "tree-vect.h"
6 #endif
7
8 extern void abort (void);
9
10 long long int p[256], r[256], t[256];
11 int q[256];
12
13 __attribute__((noinline, noclone)) void
14 foo (void)
15 {
16 int i;
17 #pragma omp simd safelen(64)
18 for (i = 0; i < 256; i++)
19 if (r[i] > 32LL)
20 t[i] = p[q[i]];
21 }
22
23 __attribute__((noinline, noclone)) void
24 bar (void)
25 {
26 int i;
27 for (i = 0; i < 256; i++)
28 {
29 r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
30 q[i] = r[i] > 32 ? ((i * 7) % 256) : 258 + i;
31 p[i] = i * 11;
32 t[i] = i * 13;
33 }
34 foo ();
35 #pragma GCC novector
36 for (i = 0; i < 256; i++)
37 if ((i >> 2) & (1 << (i & 3)))
38 {
39 if (t[i] != ((i * 7) % 256) * 11)
40 abort ();
41 }
42 else if (t[i] != i * 13)
43 abort ();
44 }
45
46 #ifndef CHECK_H
47 int
48 main ()
49 {
50 check_vect ();
51 bar ();
52 return 0;
53 }
54 #endif
55