# HG changeset patch # User adlertz # Date 1382688820 -7200 # Node ID f01788f136967806e7825b56fd1157bbb7fd5f89 # Parent 0d1661d63d703894799f1831c01dd98f3f546bf2 8026940: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc Summary: Remove input to junk phi if they also become dead during post_allocate_copy_removal Reviewed-by: roland diff -r 0d1661d63d70 -r f01788f13696 src/share/vm/opto/postaloc.cpp --- a/src/share/vm/opto/postaloc.cpp Wed Oct 23 20:20:03 2013 +0400 +++ b/src/share/vm/opto/postaloc.cpp Fri Oct 25 10:13:40 2013 +0200 @@ -97,7 +97,8 @@ static bool expected_yanked_node(Node *old, Node *orig_old) { // This code is expected only next original nodes: // - load from constant table node which may have next data input nodes: - // MachConstantBase, Phi, MachTemp, MachSpillCopy + // MachConstantBase, MachTemp, MachSpillCopy + // - Phi nodes that are considered Junk // - load constant node which may have next data input nodes: // MachTemp, MachSpillCopy // - MachSpillCopy @@ -112,7 +113,9 @@ return (old == orig_old); } else if (old->is_MachTemp()) { return orig_old->is_Con(); - } else if (old->is_Phi() || old->is_MachConstantBase()) { + } else if (old->is_Phi()) { // Junk phi's + return true; + } else if (old->is_MachConstantBase()) { return (orig_old->is_Con() && orig_old->is_MachConstant()); } return false; @@ -522,11 +525,9 @@ u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } if (u != NodeSentinel) { // Junk Phi. Remove - block->remove_node(j--); + phi->replace_by(u); + j -= yank_if_dead(phi, block, &value, ®nd); phi_dex--; - _cfg.unmap_node_from_block(phi); - phi->replace_by(u); - phi->disconnect_inputs(NULL, C); continue; } // Note that if value[pidx] exists, then we merged no new values here