Skip to content

Commit 31d178b

Browse files
committed
8281297: TestStressG1Humongous fails with guarantee(is_range_uncommitted)
Backport-of: 1ce72eabe54520845d8466c9d3ac07b60597182a
1 parent c064dce commit 31d178b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hotspot/share/utilities/bitMap.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ void BitMap::par_put_range_within_word(idx_t beg, idx_t end, bool value) {
212212
// With a valid range (beg <= end), this test ensures that end != 0, as
213213
// required by inverted_bit_mask_for_range. Also avoids an unnecessary write.
214214
if (beg != end) {
215-
bm_word_t* pw = word_addr(beg);
216-
bm_word_t w = *pw;
217-
bm_word_t mr = inverted_bit_mask_for_range(beg, end);
218-
bm_word_t nw = value ? (w | ~mr) : (w & mr);
215+
volatile bm_word_t* pw = word_addr(beg);
216+
bm_word_t w = Atomic::load(pw);
217+
bm_word_t mr = inverted_bit_mask_for_range(beg, end);
218+
bm_word_t nw = value ? (w | ~mr) : (w & mr);
219219
while (true) {
220220
bm_word_t res = Atomic::cmpxchg(nw, pw, w);
221221
if (res == w) break;

0 commit comments

Comments
 (0)