# HG changeset patch # User thartmann # Date 1469774173 -7200 # Node ID a7d6cce8c431e1317bc4e22bb42910ea5cf1ea1f # Parent 20738e6bef832906df00e37896f649c56565909d 8162540: Crash in C2 escape analysis with assert: "node should be registered" Summary: GetAndSet, CompareAndExchange and CompareAndSwap intrinsics emit unsafe accesses to oop fields. Reviewed-by: kvn diff -r 20738e6bef83 -r a7d6cce8c431 hotspot/src/share/vm/opto/escape.cpp --- a/hotspot/src/share/vm/opto/escape.cpp Thu Jul 28 09:57:49 2016 -0400 +++ b/hotspot/src/share/vm/opto/escape.cpp Fri Jul 29 08:36:13 2016 +0200 @@ -2067,7 +2067,9 @@ bt = field->layout_type(); } else { // Check for unsafe oop field access - if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN)) { + if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN) || + n->has_out_with(Op_GetAndSetP, Op_GetAndSetN, Op_CompareAndExchangeP, Op_CompareAndExchangeN) || + n->has_out_with(Op_CompareAndSwapP, Op_CompareAndSwapN, Op_WeakCompareAndSwapP, Op_WeakCompareAndSwapN)) { bt = T_OBJECT; (*unsafe) = true; } @@ -2083,7 +2085,9 @@ } } else if (adr_type->isa_rawptr() || adr_type->isa_klassptr()) { // Allocation initialization, ThreadLocal field access, unsafe access - if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN)) { + if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN) || + n->has_out_with(Op_GetAndSetP, Op_GetAndSetN, Op_CompareAndExchangeP, Op_CompareAndExchangeN) || + n->has_out_with(Op_CompareAndSwapP, Op_CompareAndSwapN, Op_WeakCompareAndSwapP, Op_WeakCompareAndSwapN)) { bt = T_OBJECT; } }