| 1 |
/* { dg-do compile } */ |
| 2 |
/* ethread threading does not yet catch this but it might at some point. */ |
| 3 |
/* { dg-options "-O -fdump-tree-fre1-details -fno-thread-jumps" } */ |
| 4 |
|
| 5 |
int foo (int b, int x) |
| 6 |
{ |
| 7 |
int i, j; |
| 8 |
if (b) |
| 9 |
i = x; |
| 10 |
if (b) |
| 11 |
j = x; |
| 12 |
return j == i; |
| 13 |
} |
| 14 |
|
| 15 |
/* Even with different undefs we should CSE a PHI node with the |
| 16 |
same controlling condition. */ |
| 17 |
|
| 18 |
/* { dg-final { scan-tree-dump "Replaced redundant PHI node" "fre1" } } */ |
| 19 |
/* { dg-final { scan-tree-dump "return 1;" "fre1" } } */ |