| 1 |
/* { dg-do compile } */ |
| 2 |
/* Phi-OPT should be able to optimize this without sinking being invoked. */ |
| 3 |
/* { dg-options "-O -fdump-tree-phiopt2 -fdump-tree-optimized -fno-tree-sink" } */ |
| 4 |
|
| 5 |
char *f(char *a, __SIZE_TYPE__ b) { |
| 6 |
char *d = a + b; |
| 7 |
if (b == 0) return a; |
| 8 |
return d; |
| 9 |
} |
| 10 |
int sub(int a, int b, int c) { |
| 11 |
int d = a - b; |
| 12 |
if (b == 0) return a; |
| 13 |
return d; |
| 14 |
} |
| 15 |
|
| 16 |
/* { dg-final { scan-tree-dump-not "goto" "phiopt2" } } */ |
| 17 |
/* { dg-final { scan-tree-dump-not "goto" "optimized" } } */ |