[Bug c++/60272] atomic<>::compare_exchange_weak has spurious store and can cause race conditions
torvald at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 19 18:19:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60272
--- Comment #2 from torvald at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #1)
> So, either we'd need to change this function, so that it sets oldval to
> NULL_RTX
> first, and passes ..., &oldval, mem, expected, ... and needs to also always
> ask for target, then conditionally on target store to expected, or perhaps
> add extra parameter to expand_atomic_compare_and_swap and do the store only
> conditionally in that case. Richard/Torvald?
I'm not sure what's better. But getting this fixed in 4.9.0 would be good! :)
More information about the Gcc-bugs
mailing list