From 1ce72eabe54520845d8466c9d3ac07b60597182a Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Mon, 9 May 2022 07:16:54 +0000 Subject: [PATCH] 8281297: TestStressG1Humongous fails with guarantee(is_range_uncommitted) Reviewed-by: eosterlund, iwalulya, tschatzl --- src/hotspot/share/utilities/bitMap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/utilities/bitMap.cpp b/src/hotspot/share/utilities/bitMap.cpp index ab37af95fca..f62aa9d90d3 100644 --- a/src/hotspot/share/utilities/bitMap.cpp +++ b/src/hotspot/share/utilities/bitMap.cpp @@ -232,10 +232,10 @@ void BitMap::par_put_range_within_word(idx_t beg, idx_t end, bool value) { // With a valid range (beg <= end), this test ensures that end != 0, as // required by inverted_bit_mask_for_range. Also avoids an unnecessary write. if (beg != end) { - bm_word_t* pw = word_addr(beg); - bm_word_t w = *pw; - bm_word_t mr = inverted_bit_mask_for_range(beg, end); - bm_word_t nw = value ? (w | ~mr) : (w & mr); + volatile bm_word_t* pw = word_addr(beg); + bm_word_t w = Atomic::load(pw); + bm_word_t mr = inverted_bit_mask_for_range(beg, end); + bm_word_t nw = value ? (w | ~mr) : (w & mr); while (true) { bm_word_t res = Atomic::cmpxchg(pw, w, nw); if (res == w) break;