1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 /* This tests that nonoveralpping_component_refs does not give up
5 on field delcs and continues looking to find mismatch between
6 a1 and a2. */
7 struct a {
8 int a:3;
9 int b:3;
10 };
11 struct b {struct a a1,a2;};
12 struct c {struct b b[10];} *cptr;
13 struct d {struct c c;} *dptr;
14 int
test(int i,int j)15 test(int i,int j)
16 {
17 cptr->b[i].a1.a=0;
18 dptr->c.b[j].a2.b=1;
19 return cptr->b[i].a1.a;
20 }
21 int
test2(int i,int j)22 test2(int i,int j)
23 {
24 cptr->b[i].a1.a=1;
25 dptr->c.b[j].a1.a=0;
26 return cptr->b[i].a1.a;
27 }
28 /* { dg-final { scan-tree-dump-times "return 0" 1 "optimized"} } */
29 /* { dg-final { scan-tree-dump-not "return 1" "optimized"} } */
30