On Fri, Nov 09, 2018 at 01:13:28PM +0200, Janne Blomqvist wrote:
> The old __sync builtins have been deprecated for a long time now in
> favor of the __atomic builtins following the C++11/C11 memory model.
> This patch converts libgfortran to use the modern __atomic builtins.
> 
> At the same time I weakened the consistency to acquire-release as that
> should be enough for this particular case.  Jakub, as the original
> author of the algorithm, do you concur?

As mentioned on IRC, I think this could use just __ATOMIC_RELAXED,
but am not 100% sure.

> 2018-11-09  Janne Blomqvist  <j...@gcc.gnu.org>
> 
>       * acinclude.m4 (LIBGFOR_CHECK_ATOMIC_FETCH_ADD): Rename and test
>       presence of atomic builtins instead of sync builtins.
>       * configure.ac (LIBGFOR_CHECK_ATOMIC_FETCH_ADD): Call new test.
>       * io/io.h (inc_waiting_locked): Use __atomic_fetch_add.
>       (predec_waiting_locked): Use __atomic_add_fetch.
>       (dec_waiting_unlocked): Use __atomic_fetch_add.
>       * config.h.in: Regenerated.
>       * configure: Regenerated.

        Jakub

Reply via email to