summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c
blob: ab4182246a35473d0177afd15f31eed8ea263437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-ccp1" } */

struct f { int i; };
int g()
{
  struct f a, *a1;
  int *i;
  a.i = 1;
  a1 = &a;
  i = &a1->i;
  return *i;  /* This should be turned into a.i */
}

/* { dg-final { scan-tree-dump "= a.i;" "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */