| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fdump-tree-optimized-raw" } */ |
| 3 |
/* PR tree-optimization/111432 */ |
| 4 |
|
| 5 |
int |
| 6 |
foo3(int c, int bb) |
| 7 |
{ |
| 8 |
if ((bb & ~3)!=0) __builtin_unreachable(); |
| 9 |
return (bb & (c|3)); |
| 10 |
} |
| 11 |
|
| 12 |
int |
| 13 |
foo_bool(int c, _Bool bb) |
| 14 |
{ |
| 15 |
return (bb & (c|7)); |
| 16 |
} |
| 17 |
|
| 18 |
/* Both of these functions should be able to remove the `IOR` and `AND` |
| 19 |
as the only bits that are non-zero for bb is set on the other side |
| 20 |
of the `AND`. |
| 21 |
*/ |
| 22 |
|
| 23 |
/* { dg-final { scan-tree-dump-not "bit_ior_expr, " "optimized" } } */ |
| 24 |
/* { dg-final { scan-tree-dump-not "bit_and_expr, " "optimized" } } */ |