| 1 |
/* PR tree-optimization/25501 |
| 2 |
The PHI merge pass used to try to merge PHI nodes that cannot |
| 3 |
actually merged, causing a segfault later. Make sure that does not |
| 4 |
happen any more. */ |
| 5 |
|
| 6 |
/* { dg-options "-O1 -fdump-tree-mergephi1" } */ |
| 7 |
|
| 8 |
int |
| 9 |
foo (int a) |
| 10 |
{ |
| 11 |
int b; |
| 12 |
int c; |
| 13 |
int d; |
| 14 |
|
| 15 |
if (a == 2) |
| 16 |
b = 3; |
| 17 |
else |
| 18 |
b = 5; |
| 19 |
|
| 20 |
c = 7; |
| 21 |
|
| 22 |
d = 11; |
| 23 |
|
| 24 |
for (;;) |
| 25 |
{ |
| 26 |
if (d == 5) |
| 27 |
break; |
| 28 |
|
| 29 |
d = b; |
| 30 |
} |
| 31 |
|
| 32 |
return 13; |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi1"} } */ |