1 /* PR middle-end/48335 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-O2 -fno-tree-sra" } */ 4 5 typedef short U __attribute__((may_alias, aligned (1))); 6 7 struct S 8 { 9 double d; 10 }; 11 12 int f1(struct S x)13f1 (struct S x) 14 { 15 struct S s = x; 16 return ((U *)((char *) &s.d + 1))[-1]; 17 } 18 19 int f2(struct S x)20f2 (struct S x) 21 { 22 struct S s = x; 23 return ((U *)((char *) &s.d + 1))[-2]; 24 } 25 26 int f3(struct S x)27f3 (struct S x) 28 { 29 struct S s = x; 30 return ((U *)((char *) &s.d + 1))[5]; 31 } 32