aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp92.c
blob: 213aa47609a359e5e618e2380a37b716376c3f5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1-details -fdisable-tree-ethread" } */

void bar (void);
int foo (int i, int j)
{
  int res = 1;
  if (i < j)
    {
      /* We should be able to simplify the following conditional
         during propagation.  */
      if (i > j)
	res = 0;
    }
  /* And compute res as having a value-range of [1,1].  */
  if (res)
    return i;
  return j;
}

/* { dg-final { scan-tree-dump "res_.: \\\[1, 1\\\]" "vrp1" } } */
/* { dg-final { scan-tree-dump-not "Threaded" "vrp1" } } */