Commit Graph

1746 Commits

Author SHA1 Message Date
Florian Weimer
cf611de73d or1k: Fix -Wincompatible-pointer-types warning during libgcc build
libgcc/

	* config/or1k/linux-unwind.h (or1k_fallback_frame_state): Add
	missing cast.
2023-10-13 09:34:37 +02:00
Florian Weimer
dab4f3ec0d arc: Fix -Wincompatible-pointer-types warning during libgcc build
libgcc/

	* config/arc/linux-unwind.h (arc_fallback_frame_state): Add
	missing cast.
2023-10-13 09:34:36 +02:00
Florian Weimer
fbd3923887 riscv: Fix -Wincompatible-pointer-types warning during libgcc build
libgcc/

	* config/riscv/linux-unwind.h (riscv_fallback_frame_state): Add
	missing cast.
2023-10-13 09:34:36 +02:00
Florian Weimer
6e5216ec17 csky: Fix -Wincompatible-pointer-types warning during libgcc build
libgcc/

	* config/csky/linux-unwind.h (csky_fallback_frame_state): Add
	missing cast.
2023-10-13 09:34:36 +02:00
Florian Weimer
bdbca405e1 m68k: Avoid implicit function declaration in libgcc
libgcc/

	* config/m68k/fpgnulib.c (__cmpdf2): Declare.
2023-10-13 09:34:36 +02:00
GCC Administrator
f9ef2e6dcd Daily bump. 2023-10-13 00:18:18 +00:00
Georg-Johann Lay
cd0185b8d1 LibF7: Implement atan2.
libgcc/config/avr/libf7/
	* libf7.c (F7MOD_atan2_, f7_atan2): New module and function.
	* libf7.h: Adjust comments.
	* libf7-common.mk (CALL_PROLOGUES): Add atan2.
2023-10-12 15:34:06 +02:00
GCC Administrator
6c44b95d97 Daily bump. 2023-10-06 00:17:37 +00:00
Georg-Johann Lay
a28f097085 LibF7: Remove uses of attribute pure.
libgcc/config/avr/libf7/
	* libf7.h (F7_PURE): Remove all occurrences.
	* libf7.c: Same.
2023-10-05 15:26:22 +02:00
Georg-Johann Lay
c4f05cb6f3 LibF7: Use monic denominator polynomials to save a multiplication.
libgcc/config/avr/libf7/
	* libf7.h (F7_FLAGNO_plusx, F7_FLAG_plusx): New macros.
	* libf7.c (f7_horner): Handle F7_FLAG_plusx in highest coefficient.
	* libf7-const.def [F7MOD_atan_]: Denominator: Set F7_FLAG_plusx
	and omit highest term.
	[F7MOD_asinacos_]: Use rational function with normalized denominator.
2023-10-05 15:00:12 +02:00
GCC Administrator
0d9b4e8647 Daily bump. 2023-09-28 09:50:12 +00:00
Wilco Dijkstra
e1e18ea0de AArch64: Remove BTI from outline atomics
The outline atomic functions have hidden visibility and can only be called
directly.  Therefore we can remove the BTI at function entry.  This improves
security by reducing the number of indirect entry points in a binary.
The BTI markings on the objects are still emitted.

libgcc/ChangeLog:
	* config/aarch64/lse.S (BTI_C): Remove define.
2023-09-26 16:37:38 +01:00
GCC Administrator
4907d220be Daily bump. 2023-09-21 00:17:49 +00:00
Pekka Seppänen
0a59ff65df aarch64: Ensure const and sign correctness
Be const and sign correct by using a matching CIE augmentation type.
Use a builtin instead of relying <string.h> being included.

libgcc/ChangeLog:

	* config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key):
	Use const unsigned type and a builtin.

Signed-off-by: Pekka Seppänen <pexu@gcc.mail.kapsi.fi>
2023-09-20 19:41:01 +01:00
GCC Administrator
a134b6ce8e Daily bump. 2023-09-07 00:17:36 +00:00
Jakub Jelinek
f6e0ec5696 libgcc _BitInt helper documentation [PR102989]
On Mon, Aug 21, 2023 at 05:32:04PM +0000, Joseph Myers wrote:
> I think the libgcc functions (i.e. those exported by libgcc, to which
> references are generated by the compiler) need documenting in libgcc.texi.
> Internal functions or macros in the libgcc patch need appropriate comments
> specifying their semantics; especially FP_TO_BITINT and FP_FROM_BITINT
> which have a lot of arguments and no comments saying what the semantics of
> the macros and their arguments are supposed to me.

Here is an incremental patch which does that.

2023-09-06  Jakub Jelinek  <jakub@redhat.com>

	PR c/102989
gcc/
	* doc/libgcc.texi (Bit-precise integer arithmetic functions):
	Document general rules for _BitInt support library functions
	and document __mulbitint3 and __divmodbitint4.
	(Conversion functions): Document __fix{s,d,x,t}fbitint,
	__floatbitint{s,d,x,t,h,b}f, __bid_fix{s,d,t}dbitint and
	__bid_floatbitint{s,d,t}d.
libgcc/
	* libgcc2.c (bitint_negate): Add function comment.
	* soft-fp/bitint.h (bitint_negate): Add function comment.
	(FP_TO_BITINT, FP_FROM_BITINT): Add comment explaining the macros.
2023-09-06 17:42:37 +02:00
Jakub Jelinek
2ce182e258 libgcc _BitInt support [PR102989]
This patch adds the library helpers for multiplication, division + modulo
and casts from and to floating point (both binary and decimal).
As described in the intro, the first step is try to reduce further the
passed in precision by skipping over most significant limbs with just zeros
or sign bit copies.  For multiplication and division I've implemented
a simple algorithm, using something smarter like Karatsuba or Toom N-Way
might be faster for very large _BitInts (which we don't support right now
anyway), but could mean more code in libgcc, which maybe isn't what people
are willing to accept.
For the to/from floating point conversions the patch uses soft-fp, because
it already has tons of handy macros which can be used for that.  In theory
it could be implemented using {,unsigned} long long or {,unsigned} __int128
to/from floating point conversions with some frexp before/after, but at that
point we already need to force it into integer registers and analyze it
anyway.  Plus, for 32-bit arches there is no __int128 that could be used
for XF/TF mode stuff.
I know that soft-fp is owned by glibc and I think the op-common.h change
should be propagated there, but the bitint stuff is really GCC specific
and IMHO doesn't belong into the glibc copy.

2023-09-06  Jakub Jelinek  <jakub@redhat.com>

	PR c/102989
libgcc/
	* config/aarch64/t-softfp (softfp_extras): Use += rather than :=.
	* config/i386/64/t-softfp (softfp_extras): Likewise.
	* config/i386/libgcc-glibc.ver (GCC_14.0.0): Export _BitInt support
	routines.
	* config/i386/t-softfp (softfp_extras): Add fixxfbitint and
	bf, hf and xf mode floatbitint.
	(CFLAGS-floatbitintbf.c, CFLAGS-floatbitinthf.c): Add -msse2.
	* config/riscv/t-softfp32 (softfp_extras): Use += rather than :=.
	* config/rs6000/t-e500v1-fp (softfp_extras): Likewise.
	* config/rs6000/t-e500v2-fp (softfp_extras): Likewise.
	* config/t-softfp (softfp_floatbitint_funcs): New.
	(softfp_bid_list): New.
	(softfp_func_list): Add sf and df mode from and to _BitInt libcalls.
	(softfp_bid_file_list): New.
	(LIB2ADD_ST): Add $(softfp_bid_file_list).
	* config/t-softfp-sfdftf (softfp_extras): Add fixtfbitint and
	floatbitinttf.
	* config/t-softfp-tf (softfp_extras): Likewise.
	* libgcc2.c (bitint_reduce_prec): New inline function.
	(BITINT_INC, BITINT_END): Define.
	(bitint_mul_1, bitint_addmul_1): New helper functions.
	(__mulbitint3): New function.
	(bitint_negate, bitint_submul_1): New helper functions.
	(__divmodbitint4): New function.
	* libgcc2.h (LIBGCC2_UNITS_PER_WORD): When building _BitInt support
	libcalls, redefine depending on __LIBGCC_BITINT_LIMB_WIDTH__.
	(__mulbitint3, __divmodbitint4): Declare.
	* libgcc-std.ver.in (GCC_14.0.0): Export _BitInt support routines.
	* Makefile.in (lib2funcs): Add _mulbitint3.
	(LIB2_DIVMOD_FUNCS): Add _divmodbitint4.
	* soft-fp/bitint.h: New file.
	* soft-fp/fixdfbitint.c: New file.
	* soft-fp/fixsfbitint.c: New file.
	* soft-fp/fixtfbitint.c: New file.
	* soft-fp/fixxfbitint.c: New file.
	* soft-fp/floatbitintbf.c: New file.
	* soft-fp/floatbitintdf.c: New file.
	* soft-fp/floatbitinthf.c: New file.
	* soft-fp/floatbitintsf.c: New file.
	* soft-fp/floatbitinttf.c: New file.
	* soft-fp/floatbitintxf.c: New file.
	* soft-fp/op-common.h (_FP_FROM_INT): Add support for rsize up to
	4 * _FP_W_TYPE_SIZE rather than just 2 * _FP_W_TYPE_SIZE.
	* soft-fp/bitintpow10.c: New file.
	* soft-fp/fixsdbitint.c: New file.
	* soft-fp/fixddbitint.c: New file.
	* soft-fp/fixtdbitint.c: New file.
	* soft-fp/floatbitintsd.c: New file.
	* soft-fp/floatbitintdd.c: New file.
	* soft-fp/floatbitinttd.c: New file.
2023-09-06 17:33:05 +02:00
Jakub Jelinek
7a610d44d8 libgcc: Generated tables for _BitInt <-> _Decimal* conversions [PR102989]
The following patch adds a header with generated helper tables to support
computation of powers of 10 from 10^0 to 10^6111 inclusive into a
sufficiently large array of _BitInt limbs.  This is split from the rest
of the libgcc _BitInt support because it is quite large and together it
would run into gcc-patches mail length limits.

2023-09-06  Jakub Jelinek  <jakub@redhat.com>

	PR c/102989
libgcc/
	* soft-fp/bitintpow10.h: New file.
2023-09-06 17:31:23 +02:00
GCC Administrator
d820cd785b Daily bump. 2023-09-05 13:34:14 +00:00
Yang Yujie
976f4f9e47 LoongArch: support loongarch*-elf target
gcc/ChangeLog:

	* config.gcc: add loongarch*-elf target.
	* config/loongarch/elf.h: New file.
	Link against newlib by default.

libgcc/ChangeLog:

	* config.host: add loongarch*-elf target.
2023-09-05 11:48:16 +08:00
GCC Administrator
886afed635 Daily bump. 2023-08-12 00:17:36 +00:00
Thomas Neumann
c46bded78f preserve base pointer for __deregister_frame [PR110956]
Original bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110956
Rainer Orth successfully tested the patch on Solaris with a full bootstrap.

Some uncommon unwinding table encodings need to access the base pointer
for address computations. We do not have that information in calls to
__deregister_frame_info_bases, and previously simply used nullptr as
base pointer. That is usually fine, but for some Solaris i386 shared
libraries that results in wrong address computations.

To fix this problem we now associate the unwinding object with
the table pointer itself, which is always known, in addition to
the PC range. When deregistering a frame, we first locate the object
using the table pointer, and then use the base pointer stored within
the object to compute the PC range.

libgcc/ChangeLog:
	PR libgcc/110956
	* unwind-dw2-fde.c: Associate object with address of unwinding
	table.
2023-08-11 09:20:27 -06:00
GCC Administrator
4b92dba78d Daily bump. 2023-08-08 00:17:37 +00:00
John Ericson
9fc0ae6033
Deprecate a.out support for NetBSD targets.
As discussed previously, a.out support is now quite deprecated, and in
some cases removed, in both Binutils itself and NetBSD, so this legacy
default makes little sense. `netbsdelf*` and `netbsdaout*` still work
allowing the user to be explicit about there choice. Additionally, the
configure script warns about the change as Nick Clifton requested.

One possible concern was the status of NetBSD on NS32K, where only a.out
was supported. But per [1] NetBSD has removed support, and if it were to
come back, it would be with ELF. The binutils implementation is
therefore marked obsolete, per the instructions in the last message.

With that patch and this one applied, I have confirmed the following:

--target=i686-unknown-netbsd
--target=i686-unknown-netbsdelf
  builds completely

--target=i686-unknown-netbsdaout
  properly fails because target is deprecated.

--target=vax-unknown-netbsdaout builds completely except for gas, where
the target is deprecated.

[1]: https://mail-index.netbsd.org/tech-toolchain/2021/07/19/msg004025.html

config/ChangeLog:

	* picflag.m4: Simplify SHmedia NetBSD match by presuming ELF.

gcc/ChangeLog:

	* configure: Regenerate.

libada/ChangeLog:

	* configure: Regenerate.

libgcc/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:41 +02:00
Alan Modra
1d6c6dc947
egrep in binutils
Apparently some distros have a nagging egrep that helpfully tells you
egrep is deprecated and to use "grep -E".  The nag message causes a ld
testsuite failure.  What's more the advice isn't that good.  The "-E"
flag may not be available with older versions of grep.

This patch fixes bare invocation of egrep within binutils, replacing
it with the autoconf $EGREP or with grep.

config/ChangeLog:

	* lib-ld.m4 (AC_LIB_PROG_LD_GNU): Require AC_PROG_EGREP and
	invoke $EGREP.
	(AC_LIB_PROG_LD): Likewise.

gcc/ChangeLog:

	* configure: Regenerate.

intl/ChangeLog:

	* configure: Regenerate.

libcpp/ChangeLog:

	* configure: Regenerate.

libgcc/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:40 +02:00
GCC Administrator
82c2a34b2f Daily bump. 2023-07-24 00:16:51 +00:00
Andrew Pinski
bbc1a10273 Fix PR 110066: crash with -pg -static on riscv
The problem -fasynchronous-unwind-tables is on by default for riscv linux
We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point
to .eh_frame data from crtbeginT.o instead of the user-defined object
during static linking.

This turns it off.

OK?

libgcc/ChangeLog:

	* config.host (riscv*-*-linux*): Add t-crtstuff to tmake_file.
	(riscv*-*-freebsd*): Likewise.
	* config/riscv/t-crtstuff: New file.
2023-07-22 21:55:22 -07:00
GCC Administrator
49bed11d96 Daily bump. 2023-07-20 00:17:53 +00:00
liuhongt
9a19fa8b61 Support type _Float16/__bf16 independent of SSE2.
Enable _Float16 and __bf16 all the time but issue errors when the
types are used in conversion, unary operation, binary operation,
parameter passing or value return when TARGET_SSE2 is not available.

Also undef macros which are used by libgcc/libstdc++ to check the
backend support of the _Float16/__bf16 types when TARGET_SSE2 is not
available.

gcc/ChangeLog:

	PR target/109504
	* config/i386/i386-builtins.cc
	(ix86_register_float16_builtin_type): Remove TARGET_SSE2.
	(ix86_register_bf16_builtin_type): Ditto.
	* config/i386/i386-c.cc (ix86_target_macros): When TARGET_SSE2
	isn't available, undef the macros which are used to check the
	backend support of the _Float16/__bf16 types when building
	libstdc++ and libgcc.
	* config/i386/i386.cc (construct_container): Issue errors for
	HFmode/BFmode when TARGET_SSE2 is not available.
	(function_value_32): Ditto.
	(ix86_scalar_mode_supported_p): Remove TARGET_SSE2 for HFmode/BFmode.
	(ix86_libgcc_floating_mode_supported_p): Ditto.
	(ix86_emit_support_tinfos): Adjust codes.
	(ix86_invalid_conversion): Return diagnostic message string
	when there's conversion from/to BF/HFmode w/o TARGET_SSE2.
	(ix86_invalid_unary_op): New function.
	(ix86_invalid_binary_op): Ditto.
	(TARGET_INVALID_UNARY_OP): Define.
	(TARGET_INVALID_BINARY_OP): Define.
	* config/i386/immintrin.h [__SSE2__]: Remove for fp16/bf16
	related instrinsics header files.
	* config/i386/i386.h (VALID_SSE2_TYPE_MODE): New macro.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr109504.c: New test.
	* gcc.target/i386/sse2-bfloat16-1.c: Adjust error info.
	* gcc.target/i386/sse2-float16-1.c: Ditto.
	* gcc.target/i386/sse2-float16-4.c: New test.
	* gcc.target/i386/sse2-float16-5.c: New test.
	* g++.target/i386/float16-1.C: Adjust error info.

libgcc/ChangeLog:

	* config/i386/t-softfp: Add -msse2 to libbid HFtype related
	files.
2023-07-19 09:35:58 +08:00
GCC Administrator
af3d3ce31a Daily bump. 2023-07-12 00:17:09 +00:00
Florian Weimer
104b090052 libgcc: Fix -Wint-conversion warning in find_fde_tail
Fixes commit r14-1614-g49310a99330849 ("libgcc: Fix eh_frame fast path
in find_fde_tail").

libgcc/

	PR libgcc/110179
	* unwind-dw2-fde-dip.c (find_fde_tail): Add cast to avoid
	implicit conversion of pointer value to integer.
2023-07-11 06:19:39 +02:00
GCC Administrator
738808bd9a Daily bump. 2023-07-07 00:17:17 +00:00
Kito Cheng
0d40aeb9b8 RISC-V: Handle rouding mode correctly on zfinx
Zfinx has provide fcsr like F, so rouding mode should use fcsr instead
of `soft` fenv.

libgcc/ChangeLog:

	* config/riscv/sfp-machine.h (FP_INIT_ROUNDMODE): Check zfinx.
	(FP_HANDLE_EXCEPTIONS): Ditto.
2023-07-06 14:31:55 +08:00
GCC Administrator
e517d3f571 Daily bump. 2023-06-20 00:17:14 +00:00
Andrew Stubbs
d9d6774527 amdgcn: implement vector div and mod libfuncs
Also divmod, but only for scalar modes, for now (because there are no complex
int vectors yet).

gcc/ChangeLog:

	* config/gcn/gcn.cc (gcn_expand_divmod_libfunc): New function.
	(gcn_init_libfuncs): Add div and mod functions for all modes.
	Add placeholders for divmod functions.
	(TARGET_EXPAND_DIVMOD_LIBFUNC): Define.

libgcc/ChangeLog:

	* config/gcn/lib2-divmod-di.c: Reimplement like lib2-divmod.c.
	* config/gcn/lib2-divmod.c: Likewise.
	* config/gcn/lib2-gcn.h: Add new types and prototypes for all the
	new vector libfuncs.
	* config/gcn/t-amdgcn: Add new files.
	* config/gcn/amdgcn_veclib.h: New file.
	* config/gcn/lib2-vec_divmod-di.c: New file.
	* config/gcn/lib2-vec_divmod-hi.c: New file.
	* config/gcn/lib2-vec_divmod-qi.c: New file.
	* config/gcn/lib2-vec_divmod.c: New file.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/predcom-2.c: Avoid vectors on amdgcn.
	* gcc.dg/unroll-8.c: Likewise.
	* gcc.dg/vect/slp-26.c: Change expected results on amdgdn.
	* lib/target-supports.exp
	(check_effective_target_vect_int_mod): Add amdgcn.
	(check_effective_target_divmod): Likewise.
	* gcc.target/gcn/simd-math-3-16.c: New test.
	* gcc.target/gcn/simd-math-3-2.c: New test.
	* gcc.target/gcn/simd-math-3-32.c: New test.
	* gcc.target/gcn/simd-math-3-4.c: New test.
	* gcc.target/gcn/simd-math-3-8.c: New test.
	* gcc.target/gcn/simd-math-3-char-16.c: New test.
	* gcc.target/gcn/simd-math-3-char-2.c: New test.
	* gcc.target/gcn/simd-math-3-char-32.c: New test.
	* gcc.target/gcn/simd-math-3-char-4.c: New test.
	* gcc.target/gcn/simd-math-3-char-8.c: New test.
	* gcc.target/gcn/simd-math-3-char-run-16.c: New test.
	* gcc.target/gcn/simd-math-3-char-run-2.c: New test.
	* gcc.target/gcn/simd-math-3-char-run-32.c: New test.
	* gcc.target/gcn/simd-math-3-char-run-4.c: New test.
	* gcc.target/gcn/simd-math-3-char-run-8.c: New test.
	* gcc.target/gcn/simd-math-3-char-run.c: New test.
	* gcc.target/gcn/simd-math-3-char.c: New test.
	* gcc.target/gcn/simd-math-3-long-16.c: New test.
	* gcc.target/gcn/simd-math-3-long-2.c: New test.
	* gcc.target/gcn/simd-math-3-long-32.c: New test.
	* gcc.target/gcn/simd-math-3-long-4.c: New test.
	* gcc.target/gcn/simd-math-3-long-8.c: New test.
	* gcc.target/gcn/simd-math-3-long-run-16.c: New test.
	* gcc.target/gcn/simd-math-3-long-run-2.c: New test.
	* gcc.target/gcn/simd-math-3-long-run-32.c: New test.
	* gcc.target/gcn/simd-math-3-long-run-4.c: New test.
	* gcc.target/gcn/simd-math-3-long-run-8.c: New test.
	* gcc.target/gcn/simd-math-3-long-run.c: New test.
	* gcc.target/gcn/simd-math-3-long.c: New test.
	* gcc.target/gcn/simd-math-3-run-16.c: New test.
	* gcc.target/gcn/simd-math-3-run-2.c: New test.
	* gcc.target/gcn/simd-math-3-run-32.c: New test.
	* gcc.target/gcn/simd-math-3-run-4.c: New test.
	* gcc.target/gcn/simd-math-3-run-8.c: New test.
	* gcc.target/gcn/simd-math-3-run.c: New test.
	* gcc.target/gcn/simd-math-3-short-16.c: New test.
	* gcc.target/gcn/simd-math-3-short-2.c: New test.
	* gcc.target/gcn/simd-math-3-short-32.c: New test.
	* gcc.target/gcn/simd-math-3-short-4.c: New test.
	* gcc.target/gcn/simd-math-3-short-8.c: New test.
	* gcc.target/gcn/simd-math-3-short-run-16.c: New test.
	* gcc.target/gcn/simd-math-3-short-run-2.c: New test.
	* gcc.target/gcn/simd-math-3-short-run-32.c: New test.
	* gcc.target/gcn/simd-math-3-short-run-4.c: New test.
	* gcc.target/gcn/simd-math-3-short-run-8.c: New test.
	* gcc.target/gcn/simd-math-3-short-run.c: New test.
	* gcc.target/gcn/simd-math-3-short.c: New test.
	* gcc.target/gcn/simd-math-3.c: New test.
	* gcc.target/gcn/simd-math-4-char-run.c: New test.
	* gcc.target/gcn/simd-math-4-char.c: New test.
	* gcc.target/gcn/simd-math-4-long-run.c: New test.
	* gcc.target/gcn/simd-math-4-long.c: New test.
	* gcc.target/gcn/simd-math-4-run.c: New test.
	* gcc.target/gcn/simd-math-4-short-run.c: New test.
	* gcc.target/gcn/simd-math-4-short.c: New test.
	* gcc.target/gcn/simd-math-4.c: New test.
	* gcc.target/gcn/simd-math-5-16.c: New test.
	* gcc.target/gcn/simd-math-5-32.c: New test.
	* gcc.target/gcn/simd-math-5-4.c: New test.
	* gcc.target/gcn/simd-math-5-8.c: New test.
	* gcc.target/gcn/simd-math-5-char-16.c: New test.
	* gcc.target/gcn/simd-math-5-char-32.c: New test.
	* gcc.target/gcn/simd-math-5-char-4.c: New test.
	* gcc.target/gcn/simd-math-5-char-8.c: New test.
	* gcc.target/gcn/simd-math-5-char-run-16.c: New test.
	* gcc.target/gcn/simd-math-5-char-run-32.c: New test.
	* gcc.target/gcn/simd-math-5-char-run-4.c: New test.
	* gcc.target/gcn/simd-math-5-char-run-8.c: New test.
	* gcc.target/gcn/simd-math-5-char-run.c: New test.
	* gcc.target/gcn/simd-math-5-char.c: New test.
	* gcc.target/gcn/simd-math-5-long-16.c: New test.
	* gcc.target/gcn/simd-math-5-long-32.c: New test.
	* gcc.target/gcn/simd-math-5-long-4.c: New test.
	* gcc.target/gcn/simd-math-5-long-8.c: New test.
	* gcc.target/gcn/simd-math-5-long-run-16.c: New test.
	* gcc.target/gcn/simd-math-5-long-run-32.c: New test.
	* gcc.target/gcn/simd-math-5-long-run-4.c: New test.
	* gcc.target/gcn/simd-math-5-long-run-8.c: New test.
	* gcc.target/gcn/simd-math-5-long-run.c: New test.
	* gcc.target/gcn/simd-math-5-long.c: New test.
	* gcc.target/gcn/simd-math-5-run-16.c: New test.
	* gcc.target/gcn/simd-math-5-run-32.c: New test.
	* gcc.target/gcn/simd-math-5-run-4.c: New test.
	* gcc.target/gcn/simd-math-5-run-8.c: New test.
	* gcc.target/gcn/simd-math-5-run.c: New test.
	* gcc.target/gcn/simd-math-5-short-16.c: New test.
	* gcc.target/gcn/simd-math-5-short-32.c: New test.
	* gcc.target/gcn/simd-math-5-short-4.c: New test.
	* gcc.target/gcn/simd-math-5-short-8.c: New test.
	* gcc.target/gcn/simd-math-5-short-run-16.c: New test.
	* gcc.target/gcn/simd-math-5-short-run-32.c: New test.
	* gcc.target/gcn/simd-math-5-short-run-4.c: New test.
	* gcc.target/gcn/simd-math-5-short-run-8.c: New test.
	* gcc.target/gcn/simd-math-5-short-run.c: New test.
	* gcc.target/gcn/simd-math-5-short.c: New test.
	* gcc.target/gcn/simd-math-5.c: New test.
2023-06-19 12:35:35 +01:00
Andrew Stubbs
1ff8ba48a2 amdgcn: Delete inactive libfuncs
The HImode libfuncs weren't called and trying to enable them fails because
TARGET_PROMOTE_FUNCTION_MODE wants to widen the arguments but the signedness
isn't known.

libgcc/ChangeLog:

	* config/gcn/lib2-gcn.h (QItype, UQItype, HItype, UHItype): Delete.
	(__divhi3, __modhi3, __udivhi3, __umodhi3): Delete.
	* config/gcn/t-amdgcn: Don't build lib2-divmod-hi.c.
	* config/gcn/lib2-divmod-hi.c: Removed.
2023-06-19 12:35:34 +01:00
GCC Administrator
8c5b136583 Daily bump. 2023-06-08 00:17:20 +00:00
Florian Weimer
49310a9933 libgcc: Fix eh_frame fast path in find_fde_tail
The eh_frame value is only used by linear_search_fdes, not the binary
search directly in find_fde_tail, so the bug is not immediately
apparent with most programs.

Fixes commit e724b0480b ("libgcc:
Special-case BFD ld unwind table encodings in find_fde_tail").

libgcc/

	PR libgcc/109712
	* unwind-dw2-fde-dip.c (find_fde_tail): Correct fast path for
	parsing eh_frame.
2023-06-07 17:55:20 +02:00
GCC Administrator
14da764809 Daily bump. 2023-06-06 00:17:33 +00:00
Kewen Lin
83c3550ee9 libgcc: Use initarray section type for .init_stack
One of my workmates found there is a warning like:

  libgcc/config/rs6000/morestack.S:402: Warning: ignoring
    incorrect section type for .init_array.00000

when compiling libgcc/config/rs6000/morestack.S.

Since commit r13-6545 touched that file recently, which was
suspected to be responsible for this warning, I did some
investigation and found this is a warning staying for a long
time.  For section .init_stack*, it's preferred to use
section type SHT_INIT_ARRAY.  So this patch is use
"@init_array" to replace "@progbits".

Although the warning is trivial, Segher suggested me to
post this to fix it, in order to avoid any possible
misunderstanding/confusion on the warning.

As Alan confirmed, this doesn't require a premise check
on if the existing binutils supports "@init_array" or not,
"because if you want split-stack to work, you must link
with gold, any version of binutils that has gold has an
assembler that understands @init_array". (Thanks Alan!)

libgcc/ChangeLog:

	* config/i386/morestack.S: Use @init_array rather than
	@progbits for section type of section .init_array.
	* config/rs6000/morestack.S: Likewise.
	* config/s390/morestack.S: Likewise.
2023-06-04 22:39:32 -05:00
YunQiang Su
29b7454553 MIPS: Add speculation_barrier support
speculation_barrier for MIPS needs sync+jr.hb (r2+),
so we implement __speculation_barrier in libgcc, like arm32 does.

gcc/ChangeLog:
	* config/mips/mips-protos.h (mips_emit_speculation_barrier): New
	prototype.
	* config/mips/mips.cc (speculation_barrier_libfunc): New static
	variable.
	(mips_init_libfuncs): Initialize it.
	(mips_emit_speculation_barrier): New function.
	* config/mips/mips.md (speculation_barrier): Call
	mips_emit_speculation_barrier.

libgcc/ChangeLog:
	* config/mips/lib1funcs.S: New file.
	define __speculation_barrier and include mips16.S.
	* config/mips/t-mips: define LIB1ASMSRC as mips/lib1funcs.S.
	define LIB1ASMFUNCS as _speculation_barrier.
	set version info for __speculation_barrier.
	* config/mips/libgcc-mips.ver: New file.
	* config/mips/t-mips16: don't define LIB1ASMSRC as mips16.S
	included in lib1funcs.S now.
2023-06-05 11:22:00 +08:00
GCC Administrator
321cee7e29 Daily bump. 2023-06-04 00:16:43 +00:00
Thomas Neumann
38e88d41f5 fix radix sort on 32bit platforms [PR109670]
The radix sort uses two buffers, a1 for input and a2 for output.
After every digit the role of the two buffers is swapped.
When terminating the sort early the code made sure the output
was in a2.  However, when we run out of bits, as can happen on
32bit platforms, the sorted result was in a1, as we had just
swapped a1 and a2.
This patch fixes the problem by unconditionally having a1 as
output after every loop iteration.

This bug manifested itself only on 32bit platforms and even then
only in some circumstances, as it needs frames where a swap
is required due to differences in the top-most byte, which is
affected by ASLR. The new logic was validated by exhaustive
search over 32bit input values.

libgcc/ChangeLog:
	PR libgcc/109670
	* unwind-dw2-fde.c: Fix radix sort buffer management.
2023-06-03 09:45:48 +02:00
Thomas Neumann
5cf60b6ba1 release the sorted FDE array when deregistering a frame [PR109685]
The atomic fastpath bypasses the code that releases the sort
array which was lazily allocated during unwinding. We now
check after deregistering if there is an array to free.

libgcc/ChangeLog:
	PR libgcc/109685
	* unwind-dw2-fde.c: Free sort array in atomic fast path.
2023-06-03 09:45:43 +02:00
GCC Administrator
5df01f89b7 Daily bump. 2023-05-20 00:16:40 +00:00
Iain Sandoe
20b8779ea9 Darwin, libgcc : Adjust min version supported for the OS.
Tools from later versions of the OS deprecate or fail to support
earlier OS revisions.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libgcc/ChangeLog:

	* config.host: Arrange to set min Darwin OS versions from
	the configured host version.
	* config/darwin10-unwind-find-enc-func.c: Do not use current
	headers, but declare the nexessary structures locally to the
	versions in use for Mac OSX 10.6.
	* config/t-darwin: Amend to handle configured min OS
	versions.
	* config/t-darwin-min-1: New.
	* config/t-darwin-min-5: New.
	* config/t-darwin-min-8: New.
2023-05-19 09:06:01 +01:00
GCC Administrator
3427b51bcc Daily bump. 2023-05-16 00:17:47 +00:00
Thomas Neumann
30adfb85ff fix assert in non-atomic path
The non-atomic path does not have range information,
we have to adjust the assert handle that case, too.

libgcc/ChangeLog:
	* unwind-dw2-fde.c: Fix assert in non-atomic path.
2023-05-15 15:17:21 +02:00
Sören Tempel
9be9be828d fix assert in __deregister_frame_info_bases
The assertion in __deregister_frame_info_bases assumes that for every
frame something was inserted into the lookup data structure by
__register_frame_info_bases. Unfortunately, this does not necessarily
hold true as the btree_insert call in __register_frame_info_bases will
not insert anything for empty ranges. Therefore, we need to explicitly
account for such empty ranges in the assertion as `ob` will be a null
pointer for such ranges, hence causing the assertion to fail.

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>

libgcc/ChangeLog:
	* unwind-dw2-fde.c: Accept empty ranges when deregistering frames.
2023-05-15 11:46:29 +02:00
GCC Administrator
d7cb9720ed Daily bump. 2023-05-03 00:17:11 +00:00