--- old/src/share/vm/opto/compile.cpp 2013-11-04 10:45:03.235683297 +0100 +++ new/src/share/vm/opto/compile.cpp 2013-11-04 10:45:03.139683300 +0100 @@ -3018,12 +3018,17 @@ // Phi nodes shouldn't be moved. They would only match below if they // had the same control as the MathExactNode. The only time that // would happen is if the Phi is also an input to the MathExact - if (!out->is_Phi()) { - if (out->in(0) == NULL) { - out->set_req(0, non_throwing); - } else if (out->in(0) == ctrl) { - out->set_req(0, non_throwing); - } + // + // Cmp nodes shouldn't have control set at all. + if (out->is_Phi() || + out->is_Cmp()) { + continue; + } + + if (out->in(0) == NULL) { + out->set_req(0, non_throwing); + } else if (out->in(0) == ctrl) { + out->set_req(0, non_throwing); } } }