diff -r cbcfa2a6fe0b -r 3240e478a30e hotspot/src/share/vm/c1/c1_LIRGenerator.cpp --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Fri Nov 06 10:06:51 2015 -1000 +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Oct 21 10:37:50 2015 +0200 @@ -1761,7 +1761,7 @@ post_barrier(object.result(), value.result()); } - if (is_volatile && os::is_MP()) { + if (!support_IRIW_for_not_multiple_copy_atomic_cpu && is_volatile && os::is_MP()) { __ membar(); } } @@ -1822,6 +1822,10 @@ address = generate_address(object.result(), x->offset(), field_type); } + if (support_IRIW_for_not_multiple_copy_atomic_cpu && is_volatile && os::is_MP()) { + __ membar(); + } + bool needs_atomic_access = is_volatile || AlwaysAtomicAccesses; if (needs_atomic_access && !needs_patching) { volatile_field_load(address, reg, info); @@ -2238,6 +2242,10 @@ LIR_Opr value = rlock_result(x, x->basic_type()); + if (support_IRIW_for_not_multiple_copy_atomic_cpu && x->is_volatile() && os::is_MP()) { + __ membar(); + } + get_Object_unsafe(value, src.result(), off.result(), type, x->is_volatile()); #if INCLUDE_ALL_GCS @@ -2395,7 +2403,7 @@ if (x->is_volatile() && os::is_MP()) __ membar_release(); put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile()); - if (x->is_volatile() && os::is_MP()) __ membar(); + if (!support_IRIW_for_not_multiple_copy_atomic_cpu && x->is_volatile() && os::is_MP()) __ membar(); }