gcc/libgcc
John David Anglin cf467fb93b 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.
2023-01-13 19:24:15 +00:00
..
config Fix support for atomic loads and stores on hppa. 2023-01-13 19:24:15 +00:00
soft-fp
ChangeLog Daily bump. 2023-01-08 00:16:59 +00:00
config.host Fix support for atomic loads and stores on hppa. 2023-01-13 19:24:15 +00:00
config.in
configure
configure.ac
crtstuff.c
dfp-bit.c
dfp-bit.h
divmod.c
emutls.c
enable-execute-stack-empty.c
enable-execute-stack-mprotect.c
find-symver.awk
fixed-bit.c
fixed-bit.h
fixed-obj.mk
floatunsidf.c
floatunsisf.c
floatunsitf.c
floatunsixf.c
fp-bit.c
fp-bit.h
gbl-ctors.h
gcov.h
gen-fixed.sh
generic-morestack-thread.c
generic-morestack.c
generic-morestack.h
gstdint.h
gthr-posix.h
gthr-single.h
gthr.h
libgcc2.c Always define WIN32_LEAN_AND_MEAN before <windows.h> 2023-01-07 06:51:06 +00:00
libgcc2.h
libgcc-std.ver.in
libgcov-driver-system.c
libgcov-driver.c
libgcov-interface.c
libgcov-merge.c
libgcov-profiler.c
libgcov-util.c
libgcov.h
Makefile.in
memcmp.c
memcpy.c
memmove.c
memset.c
mkheader.sh
mkmap-flat.awk
mkmap-symver.awk
offloadstuff.c
shared-object.mk
siditi-object.mk
static-object.mk
sync.c
udivhi3.c
udivmod.c
udivmodhi4.c
udivmodsi4.c
unwind-arm-common.inc
unwind-c.c
unwind-compat.c
unwind-compat.h
unwind-dw2-btree.h
unwind-dw2-execute_cfa.h libgcc: Specialize execute_cfa_program in DWARF unwinder for alignments [redo] 2023-01-03 16:47:32 +01:00
unwind-dw2-fde-compat.c
unwind-dw2-fde-dip.c
unwind-dw2-fde.c initialize fde objects lazily 2022-12-17 00:48:25 +01:00
unwind-dw2-fde.h
unwind-dw2.c libgcc: Specialize execute_cfa_program in DWARF unwinder for alignments [redo] 2023-01-03 16:47:32 +01:00
unwind-dw2.h
unwind-generic.h Always define WIN32_LEAN_AND_MEAN before <windows.h> 2023-01-07 06:51:06 +00:00
unwind-pe.h
unwind-seh.c
unwind-sjlj.c
unwind.inc
vtv_end_preinit.c
vtv_end.c
vtv_start_preinit.c
vtv_start.c