| 1 |
/* { dg-options "-O2 -fdump-tree-phiopt" } */ |
| 2 |
|
| 3 |
/* PR tree-optimization/116699 |
| 4 |
Make sure the return PREDICT has no factor in deciding |
| 5 |
if we factor out the conversion. */ |
| 6 |
|
| 7 |
short f0(int a, int b, int c) |
| 8 |
{ |
| 9 |
int t1 = 4; |
| 10 |
if (c < t1) return (c > -1 ? c : -1); |
| 11 |
return t1; |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
short f1(int a, int b, int c) |
| 16 |
{ |
| 17 |
int t1 = 4; |
| 18 |
short t = t1; |
| 19 |
if (c < t1) t = (c > -1 ? c : -1); |
| 20 |
return t; |
| 21 |
} |
| 22 |
|
| 23 |
/* Both f1 and f0 should be optimized at phiopt1 to the same thing. */ |
| 24 |
/* { dg-final { scan-tree-dump-times "MAX_EXPR " 2 "phiopt1" } } */ |
| 25 |
/* { dg-final { scan-tree-dump-times "MIN_EXPR " 2 "phiopt1" } } */ |
| 26 |
/* { dg-final { scan-tree-dump-not "if " "phiopt1" } } */ |