-
- Downloads
Replace sync builtins with atomic builtins
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 relaxed for incrementing and decrementing the counter, and acquire-release when decrementing to check whether the counter is 0 and the unit can be freed. This is similar to e.g. std::shared_ptr in C++. Regtested on x86_64-pc-linux-gnu. libgfortran/ChangeLog: 2018-11-22 Janne Blomqvist <jb@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. * Makefile.in: Regenerated. From-SVN: r266367
Showing
- libgfortran/ChangeLog 12 additions, 0 deletionslibgfortran/ChangeLog
- libgfortran/Makefile.in 1 addition, 0 deletionslibgfortran/Makefile.in
- libgfortran/acinclude.m4 10 additions, 10 deletionslibgfortran/acinclude.m4
- libgfortran/config.h.in 3 additions, 3 deletionslibgfortran/config.h.in
- libgfortran/configure 32 additions, 20 deletionslibgfortran/configure
- libgfortran/configure.ac 2 additions, 2 deletionslibgfortran/configure.ac
- libgfortran/io/io.h 18 additions, 6 deletionslibgfortran/io/io.h
Loading
Please register or sign in to comment