| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
/* PR tree-optimization/94884 */ |
| 4 |
|
| 5 |
#define bool _Bool |
| 6 |
bool decide() __attribute((const)); |
| 7 |
|
| 8 |
inline unsigned getXOrY(unsigned x, unsigned y) |
| 9 |
{ |
| 10 |
return decide() ? y : x; |
| 11 |
} |
| 12 |
|
| 13 |
bool f(unsigned x, unsigned y) |
| 14 |
{ |
| 15 |
return (x | y) >= getXOrY(x, y); |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
/* { dg-final { scan-tree-dump-not " >= " "optimized" } } */ |
| 20 |
/* { dg-final { scan-tree-dump-not " \\\| " "optimized" } } */ |
| 21 |
/* { dg-final { scan-tree-dump-times "return 1;" 1 "optimized" } } */ |