Skip to content

Commit

Permalink
Only ignore SC stores when the load is SC
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Jan 30, 2022
1 parent 45089bc commit dbde843
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/weak_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
true
})
.filter(|&store_elem| {
// Skip over all but the last SC store
let include = !(store_elem.is_seqcst && found_sc);
found_sc |= store_elem.is_seqcst;
include
if is_seqcst {
// An SC load needs to ignore all but last store maked SC (stores not marked SC are not
// affected)
let include = !(store_elem.is_seqcst && found_sc);
found_sc |= store_elem.is_seqcst;
include
} else {
true
}
});

candidates.choose(rng)
Expand Down

0 comments on commit dbde843

Please sign in to comment.