--- old/src/share/vm/gc/g1/g1CardCounts.cpp 2016-04-06 17:17:18.194383594 +0200 +++ new/src/share/vm/gc/g1/g1CardCounts.cpp 2016-04-06 17:17:18.098383592 +0200 @@ -83,7 +83,7 @@ } } -uint G1CardCounts::add_card_count(jbyte* card_ptr) { +uint G1CardCounts::add_card_count(volatile jbyte* card_ptr) { // Returns the number of times the card has been refined. // If we failed to reserve/commit the counts table, return 0. // If card_ptr is beyond the committed end of the counts table, @@ -118,11 +118,11 @@ void G1CardCounts::clear_range(MemRegion mr) { if (has_count_table()) { - const jbyte* from_card_ptr = _ct_bs->byte_for_const(mr.start()); + const volatile jbyte* from_card_ptr = _ct_bs->byte_for_const(mr.start()); // We use the last address in the range as the range could represent the // last region in the heap. In which case trying to find the card will be an // OOB access to the card table. - const jbyte* last_card_ptr = _ct_bs->byte_for_const(mr.last()); + const volatile jbyte* last_card_ptr = _ct_bs->byte_for_const(mr.last()); #ifdef ASSERT HeapWord* start_addr = _ct_bs->addr_for(from_card_ptr);