From b86ae5c74cd83fe9986a4b64001ecbb5f1ae3a33 Mon Sep 17 00:00:00 2001 From: tschatzl Date: Mon, 10 Feb 2014 10:34:52 +0100 Subject: [PATCH] 8033545: Missing volatile specifier in Bitmap::par_put_range_within_word Summary: The method Bitmap::par_put_range_within_word reloads the original value during a CAS, which may be optimized away. Instead of reloading, use the value returned by Atomic::cmpxchg_ptr() for further processing. Reviewed-by: tschatzl, brutisso, tonyp Contributed-by: Matthias Braun --- src/share/vm/utilities/bitMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/vm/utilities/bitMap.cpp b/src/share/vm/utilities/bitMap.cpp index b67604887..8431395a6 100644 --- a/src/share/vm/utilities/bitMap.cpp +++ b/src/share/vm/utilities/bitMap.cpp @@ -107,7 +107,7 @@ void BitMap::par_put_range_within_word(idx_t beg, idx_t end, bool value) { while (true) { intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w); if (res == w) break; - w = *pw; + w = res; nw = value ? (w | ~mr) : (w & mr); } } -- GitLab