diff --git a/src/share/vm/opto/connode.cpp b/src/share/vm/opto/connode.cpp index 431ddbc62717c26e9e59b2bda570ce2f27e21023..0733394801ff1c61af09d59b35cbabb63d165497 100644 --- a/src/share/vm/opto/connode.cpp +++ b/src/share/vm/opto/connode.cpp @@ -1085,6 +1085,9 @@ Node *CastX2PNode::Ideal(PhaseGVN *phase, bool can_reshape) { switch (op) { case Op_SubX: x = in(1)->in(1); + // Avoid ideal transformations ping-pong between this and AddP for raw pointers. + if (phase->find_intptr_t_con(x, -1) == 0) + break; y = in(1)->in(2); if (fits_in_int(phase->type(y), true)) { return addP_of_X2P(phase, x, y, true);