aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-42.c
blob: 34108c83828730d73fa56eb7578e2b5bdf37b9e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-dse1" } */

int a[2];
void foo(int i, int k, int j)
{
  a[0] = i;
  if (k)
    a[0] = a[i] + k;
  else
    {
      if (j)
        a[1] = 1;
      a[0] = a[i] + 3;
    }
  a[0] = 0;
}

/* The last stores to a[0] and a[1] remain.  */
/* { dg-final { scan-tree-dump-times " = " 2 "dse1" } } */