| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
/* PR tree-optimization/116890 */ |
| 5 |
|
| 6 |
int f(_Bool a, _Bool b, int c) |
| 7 |
{ |
| 8 |
int x; |
| 9 |
if (c) x = a & b; |
| 10 |
else x = 0; |
| 11 |
return x; |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
/* The if should have been removed as the the conversion from bool to int should have been factored out. */ |
| 16 |
/* { dg-final { scan-tree-dump-not "if" "optimized" } }*/ |
| 17 |
/* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = a_\[0-9\]*.D. & b_\[0-9\]*.D." 1 "optimized" } } */ |
| 18 |
/* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = c_\[0-9\]*.D. != 0" 1 "optimized" } } */ |
| 19 |
|