Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/pr60823-3.c

raw
1 /* PR tree-optimization/60823 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fopenmp-simd -fno-strict-aliasing" } */
4
5 void bar (char *, double *);
6
7 #if __SIZEOF_DOUBLE__ >= 4
8
9 struct S { char c[sizeof (double)]; };
10 void baz (struct S, struct S);
11 union U { struct S s; double d; };
12 #ifdef __aarch64__
13 #pragma omp declare simd simdlen(2) notinbranch
14 #else
15 #pragma omp declare simd simdlen(4) notinbranch
16 #endif
17 __attribute__((noinline)) int
18 foo (double c1, double c2)
19 {
20 double *a = &c1;
21 char *b = (char *) &c1 + 2;
22
23 b[-2]++;
24 b[1]--;
25 *a++;
26 c2++;
27 bar ((char *) &c2 + 1, &c2);
28 c2 *= 3.0;
29 bar (b, a);
30 baz (((union U) { .d = c1 }).s, ((union U) { .d = c2 }).s);
31 baz (*(struct S *)&c1, *(struct S *)&c2);
32 return c1 + c2 + ((struct S *)&c1)->c[1];
33 }
34
35 #endif