aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c
blob: f08ef7fde60040a75088453180adfe78c47fa836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */ 
/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
struct s {
      int *n;
};

int
foo (__SIZE_TYPE__ i, struct s *array)
{
  int *p = array[i].n;
  if (p)
    {
      int *q = array[i].n;
      if (p != q)
	return 1;
    }
  return 0;
}
/* We should eliminate two address calculations, and one load.  */
/* We used to eliminate a cast but that was before POINTER_PLUS_EXPR
   was added.  */
/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre1"} } */
/* { dg-final { cleanup-tree-dump "fre1" } } */