1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-esra-details" } */
3 
4 struct blah
5 {
6   char a[4];
7 };
8 
9 struct str
10 {
11   struct blah b1;
12   char x;
13 };
14 
15 struct val
16 {
17   char y;
18   struct blah b2;
19 };
20 
21 union U
22 {
23   struct str str;
24   struct val val;
25 };
26 
27 
28 extern struct blah e_b1, e_b2;
29 extern union U *e_u;
30 
foo(int b)31 int foo (int b)
32 {
33   union U u;
34 
35   u.str.b1 = e_b1;
36   u.val.b2 = e_b2;
37   u.str.b1.a[3] = 0;
38 
39   *e_u = u;
40 }
41 
42 /* Epiphany has struct alignment/padding that avoids the overlap of
43    str.b1 and val.b2.  */
44 /* { dg-final { scan-tree-dump-times "Created a replacement" 0 "esra" { target { ! "epiphany-*-*" } } } } */
45