re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-8.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */
3 struct s {
4 int *n;
5 };
6
7 int
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 used to eliminate a cast but that was before POINTER_PLUS_EXPR
21 was added. */
22 /* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre"} } */
23 /* { dg-final { cleanup-tree-dump "fre" } } */