https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84411

--- Comment #5 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 64500
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64500&action=edit
Almost correct

This patch is almost correct. The only issue I think is I should just do an
atomic store still.

So basically we end up with:

if (!atomic_load_1 (&guard, __ATOMIC_ACQUIRE))
  atomic_store_n (&guard, 1, __ATOMIC_ACQ_REL);


So the overhead is still the same as before for the common case. But smaller
for the first time.

Maybe this is just a size optimization now.

Reply via email to