1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
3 struct s {
4 int *n;
5 };
6
7 int
foo(__SIZE_TYPE__ i,struct s * array)8 foo (__SIZE_TYPE__ i, struct s *array)
9 {
10 int *p = array[i].n;
11 if (p)
12 {
13 int *q = array[i].n;
14 if (p != q)
15 return 1;
16 }
17 return 0;
18 }
19 /* We should eliminate two address calculations, and one load. */
20 /* We also elimiate the PHI node feeding the return because the case
21 returning 1 is unreachable. */
22 /* We used to eliminate a cast but that was before POINTER_PLUS_EXPR
23 was added. */
24 /* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "fre1"} } */
25