| 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 |
int f(int a, int b, int c) { |
| 6 |
int d = a + b; |
| 7 |
if (c > 5) return c; |
| 8 |
if (a == 0) return b; |
| 9 |
return d; |
| 10 |
} |
| 11 |
|
| 12 |
unsigned rot(unsigned x, int n) { |
| 13 |
const int bits = __CHAR_BIT__ * __SIZEOF_INT__; |
| 14 |
int t = ((x << n) | (x >> (bits - n))); |
| 15 |
return (n == 0) ? x : t; |
| 16 |
} |
| 17 |
|
| 18 |
/* { dg-final { scan-tree-dump-times "goto" 2 "phiopt2" } } */ |
| 19 |
/* { dg-final { scan-tree-dump-times "goto" 2 "optimized" } } */ |