< prev index next >

src/share/vm/opto/lcm.cpp

Print this page
rev 9821 : 8146612: C2: Precedence edges specification violated
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -947,10 +947,17 @@
         // and then removes the last edge. If the specified edge > number of
         // edges the last edge will be moved outside of the input edges array
         // and the edge will be lost. This is why this code should be
         // executed only when Precedent (== TypeFunc::Parms) edge is present.
         Node *x = n->in(TypeFunc::Parms);
+        if (x != NULL && get_block_for_node(x) == block && n->find_prec_edge(x) != -1) {
+          // Old edge to node within same block will get removed, but no precedence
+          // edge will get added because it already exists. Update ready count.
+          int cnt = ready_cnt.at(n->_idx);
+          assert(cnt > 1, "MemBar node %d must not get ready here", n->_idx);
+          ready_cnt.at_put(n->_idx, cnt-1);
+        }
         n->del_req(TypeFunc::Parms);
         n->add_prec(x);
       }
     }
   }
< prev index next >