aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp102.c
blob: fb62e570bede628f4422e6e1819c13b459859991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1" } */

int f(int x, int y)
{ 
  int ret; 
  if (x == y)
    ret = x ^ y;
  else
    ret = 1;

  return ret;
} 

/* We should have computed x ^ y as zero and propagated the result into the
   PHI feeding the result.  */

/* { dg-final { scan-tree-dump "ret_\[0-9\]+ = PHI <\[01\]\\\(\[0-9\]+\\\), \[01\]\\\(\[0-9\]+\\\)>" "vrp1" } } */