# HG changeset patch # User lana # Date 1496342914 0 # Node ID c0501ae2ceda47d10b6dbdbe9e80fc82f405ec61 # Parent d5ed1e34de8be7bffc3a6a6299ddf7bcbeba1697# Parent e939acda146e4f13a4cb759fba6163dc8a4915f0 Merge diff -r d5ed1e34de8b -r c0501ae2ceda src/share/vm/opto/loopnode.cpp --- a/src/share/vm/opto/loopnode.cpp Thu Jun 01 18:26:33 2017 +0000 +++ b/src/share/vm/opto/loopnode.cpp Thu Jun 01 18:48:34 2017 +0000 @@ -1860,6 +1860,9 @@ if (_required_safept != NULL && _required_safept->size() > 0) { tty->print(" req={"); _required_safept->dump_simple(); tty->print(" }"); } + if (Verbose) { + tty->print(" body={"); _body.dump_simple(); tty->print(" }"); + } tty->cr(); } diff -r d5ed1e34de8b -r c0501ae2ceda src/share/vm/opto/loopopts.cpp --- a/src/share/vm/opto/loopopts.cpp Thu Jun 01 18:26:33 2017 +0000 +++ b/src/share/vm/opto/loopopts.cpp Thu Jun 01 18:48:34 2017 +0000 @@ -913,7 +913,11 @@ if (n->is_ConstraintCast()) { Node* dom_cast = n->as_ConstraintCast()->dominating_cast(this); - if (dom_cast != NULL) { + // ConstraintCastNode::dominating_cast() uses node control input to determine domination. + // Node control inputs don't necessarily agree with loop control info (due to + // transformations happened in between), thus additional dominance check is needed + // to keep loop info valid. + if (dom_cast != NULL && is_dominator(get_ctrl(dom_cast), get_ctrl(n))) { _igvn.replace_node(n, dom_cast); return dom_cast; }