1.1 --- a/src/share/vm/opto/cfgnode.cpp Tue Oct 13 20:54:13 2009 -0700 1.2 +++ b/src/share/vm/opto/cfgnode.cpp Tue Oct 13 22:32:31 2009 -0700 1.3 @@ -1531,6 +1531,8 @@ 1.4 return NULL; // No change 1.5 1.6 Node *top = phase->C->top(); 1.7 + bool new_phi = (outcnt() == 0); // transforming new Phi 1.8 + assert(!can_reshape || !new_phi, "for igvn new phi should be hooked"); 1.9 1.10 // The are 2 situations when only one valid phi's input is left 1.11 // (in addition to Region input). 1.12 @@ -1550,6 +1552,12 @@ 1.13 } 1.14 } 1.15 1.16 + if (can_reshape && outcnt() == 0) { 1.17 + // set_req() above may kill outputs if Phi is referenced 1.18 + // only by itself on the dead (top) control path. 1.19 + return top; 1.20 + } 1.21 + 1.22 Node* uin = unique_input(phase); 1.23 if (uin == top) { // Simplest case: no alive inputs. 1.24 if (can_reshape) // IGVN transformation 1.25 @@ -1684,8 +1692,7 @@ 1.26 // Equivalent code is in MemNode::Ideal_common 1.27 Node *m = phase->transform(n); 1.28 if (outcnt() == 0) { // Above transform() may kill us! 1.29 - progress = phase->C->top(); 1.30 - break; 1.31 + return top; 1.32 } 1.33 // If transformed to a MergeMem, get the desired slice 1.34 // Otherwise the returned node represents memory for every slice