diff src/share/vm/opto/macro.cpp @ 4769:9c87bcb3b4dd

7125879: assert(proj != NULL) failed: must be found Summary: Leave i_o attached to slow allocation call when there are no i_o users after the call. Reviewed-by: iveresov, twisti
author kvn
date Fri, 30 Dec 2011 11:43:06 -0800
parents d12a66fa3820
children e9a5e0a812c8
line wrap: on
line diff
--- a/src/share/vm/opto/macro.cpp	Thu Dec 29 11:37:50 2011 -0800
+++ b/src/share/vm/opto/macro.cpp	Fri Dec 30 11:43:06 2011 -0800
@@ -1503,9 +1503,16 @@
   // if we generated only a slow call, we are done
   if (always_slow) {
     // Now we can unhook i_o.
-    call->set_req(TypeFunc::I_O, top());
-    if (result_phi_i_o->outcnt() == 0)
-      _igvn.remove_dead_node(result_phi_i_o);
+    if (result_phi_i_o->outcnt() > 1) {
+      call->set_req(TypeFunc::I_O, top());
+    } else {
+      assert(result_phi_i_o->unique_ctrl_out() == call, "");
+      // Case of new array with negative size known during compilation.
+      // AllocateArrayNode::Ideal() optimization disconnect unreachable
+      // following code since call to runtime will throw exception.
+      // As result there will be no users of i_o after the call.
+      // Leave i_o attached to this call to avoid problems in preceding graph.
+    }
     return;
   }