Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / pr48335-3.c
blob9041f591fff66b3129d104ff4d00b6fe402a3060
1 /* PR middle-end/48335 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-tree-sra" } */
5 typedef short U __attribute__((may_alias, aligned (1)));
7 struct S
9 double d;
12 void bar (struct S);
14 void
15 f1 (int x)
17 struct S s = { .d = 0.0 };
18 ((U *)((char *) &s.d + 1))[0] = x;
19 __real__ s.d *= 7.0;
20 bar (s);
23 void
24 f2 (int x)
26 struct S s = { .d = 0.0 };
27 ((U *)((char *) &s.d + 1))[1] = x;
28 __real__ s.d *= 7.0;
29 bar (s);
32 void
33 f3 (int x)
35 struct S s = { .d = 0.0 };
36 ((U *)((char *) &s.d + 1))[2] = x;
37 __real__ s.d *= 7.0;
38 bar (s);
41 void
42 f4 (int x)
44 struct S s = { .d = 0.0 };
45 ((U *)((char *) &s.d + 1))[3] = x;
46 __real__ s.d *= 7.0;
47 bar (s);