--- old/src/hotspot/share/opto/escape.cpp 2018-11-14 21:45:34.436913163 +0100 +++ new/src/hotspot/share/opto/escape.cpp 2018-11-14 21:45:34.167915171 +0100 @@ -672,10 +672,10 @@ opcode == Op_CompareAndExchangeN || opcode == Op_CompareAndExchangeP) { add_local_var_and_edge(n, PointsToNode::NoEscape, adr, NULL); } - if (!add_final_edges_unsafe_access(n, opcode)) { - ELSE_FAIL("Op_StoreP"); + if (add_final_edges_unsafe_access(n, opcode)) { + break; } - break; + ELSE_FAIL("Op_StoreP"); } case Op_AryEq: case Op_HasNegatives: @@ -757,7 +757,7 @@ bool ConnectionGraph::add_final_edges_unsafe_access(Node* n, uint opcode) { Node* adr = n->in(MemNode::Address); - const Type* adr_type = _igvn->type(adr); + const Type *adr_type = _igvn->type(adr); adr_type = adr_type->make_ptr(); #ifdef ASSERT if (adr_type == NULL) { @@ -767,6 +767,11 @@ } #endif + if (opcode == Op_GetAndSetP || opcode == Op_GetAndSetN || + opcode == Op_CompareAndExchangeN || opcode == Op_CompareAndExchangeP) { + add_local_var_and_edge(n, PointsToNode::NoEscape, adr, NULL); + } + if (adr_type->isa_oopptr() || ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) && adr_type == TypeRawPtr::NOTNULL