This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60272] atomic<>::compare_exchange_weak has spurious store and can cause race conditions
- From: "torvald at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Feb 2014 18:19:41 +0000
- Subject: [Bug c++/60272] atomic<>::compare_exchange_weak has spurious store and can cause race conditions
- Auto-submitted: auto-generated
- References: <bug-60272-4 at http dot gcc dot gnu dot org/bugzilla/>
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! :)