aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/forwprop-30.c
blob: 2c707ee040d9f75f0886275d72b454d79789e32d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */

int *p;
int *foo (int *q, int i, int j)
{
  p = q + i;
  return p + j;
}

/* We shouldn't associate (q + i) + j to q + (i + j) here as we
   need q + i as well.  */

/* { dg-final { scan-tree-dump-times "\\+" 2 "optimized" } } */