1 /* PR middle-end/48335 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-O2 -fno-tree-sra" } */ 4 5 typedef long long T __attribute__((may_alias, aligned (1))); 6 typedef short U __attribute__((may_alias, aligned (1))); 7 8 struct S 9 { 10 _Complex float d __attribute__((aligned (8))); 11 }; 12 13 void bar (struct S); 14 15 void f1(T x)16f1 (T x) 17 { 18 struct S s; 19 *(T *) ((char *) &s.d + 1) = x; 20 __real__ s.d *= 7.0; 21 bar (s); 22 } 23 24 void f2(int x)25f2 (int x) 26 { 27 struct S s = { .d = 0.0f }; 28 ((U *)((char *) &s.d + 1))[0] = x; 29 __real__ s.d *= 7.0; 30 bar (s); 31 } 32 33 void f3(int x)34f3 (int x) 35 { 36 struct S s = { .d = 0.0f }; 37 ((U *)((char *) &s.d + 1))[1] = x; 38 __real__ s.d *= 7.0; 39 bar (s); 40 } 41 42 void f4(int x)43f4 (int x) 44 { 45 struct S s = { .d = 0.0f }; 46 ((U *)((char *) &s.d + 1))[2] = x; 47 __real__ s.d *= 7.0; 48 bar (s); 49 } 50 51 void f5(int x)52f5 (int x) 53 { 54 struct S s = { .d = 0.0f }; 55 ((U *)((char *) &s.d + 1))[3] = x; 56 __real__ s.d *= 7.0; 57 bar (s); 58 } 59