| 1 |
/* PR tree-optimization/20913 |
| 2 |
COPY-PROP did not fold COND_EXPR, blocking some copy propagation |
| 3 |
opportunities. */ |
| 4 |
|
| 5 |
/* { dg-do link } */ |
| 6 |
/* { dg-options "-O2 -fno-tree-dominator-opts" } */ |
| 7 |
|
| 8 |
void link_error (void); |
| 9 |
|
| 10 |
int |
| 11 |
foo (int a, int b, int c, int d) |
| 12 |
{ |
| 13 |
int x, y; |
| 14 |
|
| 15 |
b = a; |
| 16 |
if (a == b) |
| 17 |
x = c; |
| 18 |
else |
| 19 |
{ |
| 20 |
link_error (); |
| 21 |
x = d; |
| 22 |
} |
| 23 |
|
| 24 |
if (x == c) |
| 25 |
return a; |
| 26 |
else |
| 27 |
{ |
| 28 |
link_error (); |
| 29 |
return b; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
int |
| 34 |
main() |
| 35 |
{ |
| 36 |
foo (1, 2, 3, 4); |
| 37 |
} |