aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phiprop-2.c
blob: ae0d181a43ac51adf1dc70acb1afb9c7dbe28f67 (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
26
27
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-phiopt1 -fdump-tree-phiprop1-details" } */

/* PR tree-optimization/116824 */

int g(int i, int *tt)
{
  const int t = 10;
  const int *a;
  {
    if (t < i)
    {
      *tt = 1;
      a = &t;
    }
    else
    {
      *tt = 1;
      a = &i;
    }
  }
  return *a;
}

/* Check that phiprop1 can do the insert of the loads. */
/* { dg-final { scan-tree-dump-times "Inserting PHI for result of load" 1 "phiprop1"} } */
/* { dg-final { scan-tree-dump-times "MIN_EXPR " 1 "phiopt1" } } */