| 1 |
/* PR tree-optimization/111469 */ |
| 2 |
|
| 3 |
long f; |
| 4 |
char *g; |
| 5 |
__attribute__((noinline)) |
| 6 |
char o() { |
| 7 |
char l; |
| 8 |
while (f) |
| 9 |
; |
| 10 |
l = *g; |
| 11 |
return l; |
| 12 |
} |
| 13 |
|
| 14 |
/* factor_out_conditional_conversion is able to remove the casts |
| 15 |
from the 2 bbs (correctly) |
| 16 |
but then minmax_replacement should not optimize this to a MIN_EXPR |
| 17 |
as o has side effects. */ |
| 18 |
|
| 19 |
__attribute__((noinline)) |
| 20 |
unsigned short gg(unsigned short a, unsigned short b) |
| 21 |
{ |
| 22 |
short d; |
| 23 |
if (a > b) |
| 24 |
{ |
| 25 |
d= b; |
| 26 |
} |
| 27 |
else |
| 28 |
{ |
| 29 |
o(); |
| 30 |
d = a; |
| 31 |
} |
| 32 |
return d; |
| 33 |
} |
| 34 |
|
| 35 |
int main(void) |
| 36 |
{ |
| 37 |
gg(3, 2); |
| 38 |
} |