| 1 |
/* PR tree-optimization/106164 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O1 -fdump-tree-forwprop1-details" } */ |
| 4 |
|
| 5 |
|
| 6 |
int f(int a) |
| 7 |
{ |
| 8 |
int c = a != 2; |
| 9 |
int d = a >= 2; |
| 10 |
return c & d; |
| 11 |
} |
| 12 |
int g(int b) |
| 13 |
{ |
| 14 |
int c = b != -1; |
| 15 |
int d = b <= -1; |
| 16 |
return c & d; |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
int g_(int e) |
| 21 |
{ |
| 22 |
int c = e != -2; |
| 23 |
int d = e <= -2; |
| 24 |
return c & d; |
| 25 |
} |
| 26 |
|
| 27 |
int f1(int x) |
| 28 |
{ |
| 29 |
int c = x == 2; |
| 30 |
int d = x <= 1; |
| 31 |
return c | d; |
| 32 |
} |
| 33 |
int g1(int y) |
| 34 |
{ |
| 35 |
int c = y == -1; |
| 36 |
int d = y > -1; |
| 37 |
return c | d; |
| 38 |
} |
| 39 |
int g1_(int z) |
| 40 |
{ |
| 41 |
int c = z == -2; |
| 42 |
int d = z >= -1; |
| 43 |
return c | d; |
| 44 |
} |
| 45 |
|
| 46 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = a_\[0-9\]+.D. > 2" "forwprop1" } } */ |
| 47 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = b_\[0-9\]+.D. < -1" "forwprop1" } } */ |
| 48 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = e_\[0-9\]+.D. < -2" "forwprop1" } } */ |
| 49 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = x_\[0-9\]+.D. <= 2" "forwprop1" } } */ |
| 50 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = y_\[0-9\]+.D. >= -1" "forwprop1" } } */ |
| 51 |
/* { dg-final { scan-tree-dump "gimple_simplified to _\[0-9\]+ = z_\[0-9\]+.D. >= -2" "forwprop1" } } */ |