Re: [Gc] Re: [libatomic_ops] bug with gcc/x86_64/CAS
ivmai at mail.ru
Thu Feb 18 21:26:13 PST 2010
"Boehm, Hans" <hans.boehm at hp.com> wrote:
> > -----Original Message-----
> > From: Ivan Maidanski
> > >  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36793
> > After reading , the Q is:
> > is our asm implementation correct?
> > And if the described fix is critical to our AO_CAS_full()
> > then we should __sync_... only if gcc v4.4+ (since some 4.3
> > versions seem to contain unfixed __sync_...).
> I'm glad to see that was fixed. It was certainly not the last one. (See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42869, for which I haven't had a chance to check whether it still exists in SVN.)
> I'm not quite sure what concern you have here. Cmpxchg includes the effect of an mfence, so this matters only if we use __sync_synchronize() , which we hopefully don't. (IIRC, on some Intel platforms, xchg seemed to be a slightly faster version of mfence.)
Thanks for explaining. So, the code for amd64 AO_CAS_full() seems to be ok now.
More information about the Gc