diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp index 8e17d1d2a7a..4ec7e10cd9a 100644 --- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp +++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp @@ -332,7 +332,8 @@ Node* G1BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) co if (tightly_coupled_alloc) { assert(!use_ReduceInitialCardMarks(), "post-barriers are only needed for tightly-coupled initialization stores when ReduceInitialCardMarks is disabled"); - access.set_barrier_data(access.barrier_data() ^ G1C2BarrierPre); + // Pre-barriers are unnecessary for tightly-coupled initialization stores. + access.set_barrier_data(access.barrier_data() & ~G1C2BarrierPre); } } return BarrierSetC2::store_at_resolved(access, val);