PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr48335-7.c
blobddb15ee6ab9f00926ae10418502012d5a2d1ae7a
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 int
13 f1 (struct S x)
15 struct S s = x;
16 return ((U *)((char *) &s.d + 1))[0];
19 int
20 f2 (struct S x)
22 struct S s = x;
23 return ((U *)((char *) &s.d + 1))[1];
26 int
27 f3 (struct S x)
29 struct S s = x;
30 return ((U *)((char *) &s.d + 1))[2];
33 int
34 f4 (struct S x)
36 struct S s = x;
37 return ((U *)((char *) &s.d + 1))[3];