diff options
author | John David Anglin <danglin@gcc.gnu.org> | 2023-01-13 19:22:49 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2023-01-13 19:24:15 +0000 |
commit | cf467fb93b7b92330ddcb9c8fe7c93df45ce8e40 (patch) | |
tree | 821c49d285046168caf441f057bb2ab1e499b87c /libgcc/config/pa/t-netbsd | |
parent | 733a1b777f16cd397b43a242d9c31761f66d3da8 (diff) | |
download | gcc-cf467fb93b7b92330ddcb9c8fe7c93df45ce8e40.zip gcc-cf467fb93b7b92330ddcb9c8fe7c93df45ce8e40.tar.gz gcc-cf467fb93b7b92330ddcb9c8fe7c93df45ce8e40.tar.bz2 |
Fix support for atomic loads and stores on hppa.
This change updates the atomic libcall support to fix the following
issues:
1) A internal compiler error with -fno-sync-libcalls.
2) When sync libcalls are disabled, we don't generate libcalls for
libatomic.
3) There is no sync libcall support for targets other than linux.
As a result, non-atomic stores are silently emitted for types
smaller or equal to the word size. There are now a few atomic
libcalls in the libgcc code, so we need sync support on all
targets.
2023-01-13 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
* config/pa/pa-linux.h (TARGET_SYNC_LIBCALL): Delete define.
* config/pa/pa.cc (pa_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE
define.
* config/pa/pa.h (TARGET_SYNC_LIBCALLS): Use flag_sync_libcalls.
(MAX_SYNC_LIBFUNC_SIZE): Define.
(TARGET_CPU_CPP_BUILTINS): Define __SOFTFP__ when soft float is
enabled.
* config/pa/pa.md (atomic_storeqi): Emit __atomic_exchange_1
libcall when sync libcalls are disabled.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.
(atomic_loaddi): Emit __atomic_load_8 libcall when sync libcalls
are disabled on 32-bit target.
* config/pa/pa.opt (matomic-libcalls): New option.
* doc/invoke.texi (HPPA Options): Update.
libgcc/ChangeLog:
* config.host (hppa*64*-*-linux*): Adjust tmake_file to use
pa/t-pa64-linux.
(hppa*64*-*-hpux11*): Adjust tmake_file to use pa/t-pa64-hpux
instead of pa/t-hpux and pa/t-pa64.
* config/pa/linux-atomic.c: Define u32 type.
(ATOMIC_LOAD): Define new macro to implement atomic_load_1,
atomic_load_2, atomic_load_4 and atomic_load_8. Update sync
defines to use atomic_load calls for type.
(SYNC_LOCK_LOAD_2): New macro to implement __sync_lock_load_8.
* config/pa/sync-libfuncs.c: New file.
* config/pa/t-netbsd (LIB2ADD_ST): Define.
* config/pa/t-openbsd (LIB2ADD_ST): Define.
* config/pa/t-pa64-hpux: New file.
* config/pa/t-pa64-linux: New file.
Diffstat (limited to 'libgcc/config/pa/t-netbsd')
-rw-r--r-- | libgcc/config/pa/t-netbsd | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libgcc/config/pa/t-netbsd b/libgcc/config/pa/t-netbsd index 8b99068..1394394 100644 --- a/libgcc/config/pa/t-netbsd +++ b/libgcc/config/pa/t-netbsd @@ -7,3 +7,4 @@ LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall HOST_LIBGCC2_CFLAGS += -DELF=1 -DLINUX=1 LIB2ADD = $(srcdir)/config/pa/fptr.c +LIB2ADD_ST = $(srcdir)/config/pa/sync-libfuncs.c |