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

Boehm, Hans hans.boehm at hp.com
Thu Feb 18 21:15:26 PST 2010



> -----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 have'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

>
> Bye.
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>



More information about the Gc mailing list