RFR(XS) 8026940: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Oct 28 12:58:10 PDT 2013


Currently this code eliminates phi node only when it has unique input. But in bug case Phi node also has no users 
(outcnt == 0) since it is only the explanation why you need to do recursive removal. Do you know why we get Phi without 
uses? Why it was not eliminated when uses were removed? We do remove non-phi nodes in such case:

  558       if(n->outcnt() == 0 &&   // Dead?

I don't think one decrement is enough now:

+         phi_dex--;

because other phi nodes could be removed from the block since you remove dead nodes recursively.

Next old code may also have this problem (may process not Phi nodes because some Phi was removed recursively):

  443       for (uint k = 1; k < phi_dex; k++) {
  444         elide_copy(block->get_node(k), j, block, *blk2value[pb->_pre_order], *blk2regnd[pb->_pre_order], false);
  445       }

Please, look on all use cases of yank_if_dead_recurse() to make sure the return value is used correctly. Note, the 
expression "j -= yank_if_dead()" is fine - some previous nodes will be processed again in worst case, that is all.


On 10/24/13 11:36 AM, Niclas Adlertz wrote:
> Hi all,
> When removing junk phi nodes in post_allocate_copy_removal() we don't check if the inputs of the phi node die.
> This results in 'assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc'.
> Fix is to remove input recursively if they go dead.
> Tested with JPRT and CTW. Fixes the IeeeRecommendedTests failure.
> WEBREV: http://cr.openjdk.java.net/~adlertz/JDK-8026940/webrev00
> JBS: https://bugs.openjdk.java.net/browse/JDK-8026940
> Kind Regards,
> Niclas Adlertz

More information about the hotspot-compiler-dev mailing list