aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr87126.c
blob: 37232ba3a0a8e850656aa7b2e092e733291e2a30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-fre1" } */

int a, *b;

void f ()
{ 
  int d = 0, e = d;
  while (a++)
    ;
  if (e)
    goto L2;
L1:
  d = e;
  b = &d;
L2:
  if (d)
    goto L1;
}

/* The load of d could be eliminated if we'd value-number the
   irreducible region in RPO of the reducible result.  Likewise
   a redundant store could be removed.  */
/* { dg-final { scan-tree-dump-times "d = 0;" 1 "fre1" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-not " = d;" "fre1" { xfail *-*-* } } } */