Re[2]: [Gc] Re: [libatomic_ops] bug with gcc/x86_64/CAS

Ivan Maidanski 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
> > > [2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36793
> >
> > After reading [2], 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 http://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.)
> 
> Hans

Thanks for explaining. So, the code for amd64 AO_CAS_full() seems to be ok now.

Bye.




More information about the Gc mailing list