hotspot/src/share/vm/opto/library_call.cpp
changeset 22868 7f6eb436873b
parent 22855 d637fd28a6c3
child 22872 b6902ee5bc8d
--- a/hotspot/src/share/vm/opto/library_call.cpp	Tue Jan 07 17:24:59 2014 +0100
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Thu Jan 16 14:25:51 2014 +0100
@@ -2627,8 +2627,13 @@
     // rough approximation of type.
     need_mem_bar = true;
     // For Stores, place a memory ordering barrier now.
-    if (is_store)
+    if (is_store) {
       insert_mem_bar(Op_MemBarRelease);
+    } else {
+      if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
+        insert_mem_bar(Op_MemBarVolatile);
+      }
+    }
   }
 
   // Memory barrier to prevent normal and 'unsafe' accesses from
@@ -2717,10 +2722,13 @@
   }
 
   if (is_volatile) {
-    if (!is_store)
+    if (!is_store) {
       insert_mem_bar(Op_MemBarAcquire);
-    else
-      insert_mem_bar(Op_MemBarVolatile);
+    } else {
+      if (!support_IRIW_for_not_multiple_copy_atomic_cpu) {
+        insert_mem_bar(Op_MemBarVolatile);
+      }
+    }
   }
 
   if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder);