aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-1.c
blob: a90de8926c6712636eff3bfa6c8b78db187ab271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* Phi-OPT should be able to optimize this without sinking being invoked. */
/* { dg-options "-O -fdump-tree-phiopt2 -fdump-tree-optimized -fno-tree-sink" } */

char *f(char *a, __SIZE_TYPE__ b) {
  char *d = a + b;
  if (b == 0) return a;
  return d;
}
int sub(int a, int b, int c) {
  int d = a - b;
  if (b == 0) return a;
  return d;
}

/* { dg-final { scan-tree-dump-not "goto" "phiopt2" } } */
/* { dg-final { scan-tree-dump-not "goto" "optimized" } } */