Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / pr93582.c
blob38bf012d0cf669774f61e02059363293e1e05cdc
1 /* PR tree-optimization/93582 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Warray-bounds" } */
5 struct S {
6 unsigned int s1:1;
7 unsigned int s2:1;
8 unsigned int s3:1;
9 unsigned int s4:1;
10 unsigned int s5:4;
11 unsigned char s6;
12 unsigned short s7;
13 unsigned short s8;
15 struct T {
16 int t1;
17 int t2;
20 static inline int
21 bar (struct S *x)
23 if (x->s4)
24 return ((struct T *)(x + 1))->t1 + ((struct T *)(x + 1))->t2; /* { dg-bogus "array subscript 1 is outside array bounds of" } */
25 else
26 return 0;
29 int
30 foo (int x, int y)
32 struct S s; /* { dg-bogus "while referencing" } */
33 s.s6 = x;
34 s.s7 = y & 0x1FFF;
35 s.s4 = 0;
36 return bar (&s);
39 static inline int
40 qux (struct S *x)
42 int s4 = x->s4;
43 if (s4)
44 return ((struct T *)(x + 1))->t1 + ((struct T *)(x + 1))->t2;
45 else
46 return 0;
49 int
50 baz (int x, int y)
52 struct S s;
53 s.s6 = x;
54 s.s7 = y & 0x1FFF;
55 s.s4 = 0;
56 return qux (&s);