# HG changeset patch # User vlivanov # Date 1495803931 -10800 # Fri May 26 16:05:31 2017 +0300 # Node ID 624b7889534d5cd536f4a9de66860a9680d705b8 # Parent d53171650a2cc6c6f699c966c533b914ca9c0602 [mq]: 8179882.cast diff --git a/src/share/vm/opto/loopnode.cpp b/src/share/vm/opto/loopnode.cpp --- a/src/share/vm/opto/loopnode.cpp +++ b/src/share/vm/opto/loopnode.cpp @@ -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 --git a/src/share/vm/opto/loopopts.cpp b/src/share/vm/opto/loopopts.cpp --- a/src/share/vm/opto/loopopts.cpp +++ b/src/share/vm/opto/loopopts.cpp @@ -913,7 +913,10 @@ 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 dominance. + // It doesn'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; }