6866651: Regression: simple int sum crashes jvm (build 1.6.0_14-b08 and 1.7.0-ea-b59)

Delay dead code elimination in set_req_X to make it safe

Reviewed-by: kvn, never
This commit is contained in:
Changpeng Fang 2009-08-17 12:11:06 -07:00
parent f6f2d510b9
commit 05c34e93bd
2 changed files with 51 additions and 2 deletions

View file

@ -1622,9 +1622,11 @@ void Node::set_req_X( uint i, Node *n, PhaseIterGVN *igvn ) {
// old goes dead?
if( old ) {
switch (old->outcnt()) {
case 0: // Kill all his inputs, and recursively kill other dead nodes.
case 0:
// Put into the worklist to kill later. We do not kill it now because the
// recursive kill will delete the current node (this) if dead-loop exists
if (!old->is_top())
igvn->remove_dead_node( old );
igvn->_worklist.push( old );
break;
case 1:
if( old->is_Store() || old->has_special_unique_user() )