Commit Graph

1282 Commits

Author SHA1 Message Date
Richard Biener
d04fe5541c Update ChangeLog and version files for release 2023-07-07 07:08:39 +00:00
GCC Administrator
79a7d8fa00 Daily bump. 2023-05-22 00:18:45 +00:00
Iain Sandoe
c87db1256f 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.

(cherry picked from commit 20b8779ea9)
2023-05-21 20:00:18 +01:00
Iain Sandoe
13cea2625e Darwin, crts: Fix a build warning.
We have a shim crt for Darwin10 that implements functionality
missing in libSystem. Provide this with a prototype to silence the
warning about this.

libgcc/ChangeLog:

	* config/darwin10-unwind-find-enc-func.c: Include libgcc_tm.h.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit 7a300b413a)
2023-05-21 19:58:14 +01:00
Iain Sandoe
5bd1e853b3 libgcc, Darwin: No early install for the compatibility libgcc_s.1.dylib.
On Darwin, GCC now uses a libgcc_s.1.1 for builtins and forwards the system
unwinder.  We do, however, build a backwards compatibility libgcc_s.1.dylib.
However, this is not needed by GCC and can cause incorrect operation when
DYLD_LIBRARY_PATH is in use.

Since we do not need or use it during the build, the solution is to skip the
installation into the $build/gcc directory.

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

libgcc/ChangeLog:

	* config/t-slibgcc-darwin (install-darwin-libgcc-stubs): Skip the
	install of libgcc_s.1.dylib when the installation is into the build
	gcc directory.

(cherry picked from commit 163f0f2267)
2023-05-21 19:54:26 +01:00
GCC Administrator
c642277ccb Daily bump. 2023-05-04 00:19:22 +00:00
Jakub Jelinek
be80a2e64a i386: Call get_available_features for all CPUs with max_level >= 1 [PR100758]
get_available_features doesn't depend on cpu_model2->__cpu_{family,model}
and just sets stuff up based on CPUID leaf 1, or some extended ones,
so I wonder why are we calling it separately for Intel, AMD and Zhaoxin
and not for all other CPUs too?  I think various programs in the wild
which aren't using __builtin_cpu_{is,supports} just check the various CPUID
leafs and query bits in there, without blacklisting unknown CPU vendors,
so I think even __builtin_cpu_supports ("sse2") etc. should be reliable
if those VENDOR_{CENTAUR,CYRIX,NSC,OTHER} CPUs set those bits in CPUID leaf
1 or some extended ones.  Calling it for all CPUs also means it can be
inlined because there will be just a single caller.

I have tested it on Intel and Martin tested it on AMD, but can't test it
on non-Intel/AMD; for Intel/AMD/Zhaoxin it should be really no change in
behavior.

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

	PR target/100758
	* config/i386/cpuinfo.c (cpu_indicator_init): Call
	get_available_features for all CPUs with max_level >= 1, rather
	than just Intel or AMD.

(cherry picked from commit b24e9c0830)
2023-05-03 14:47:47 +02:00
GCC Administrator
2f2567780d Daily bump. 2023-02-21 00:19:52 +00:00
Nelson Chu
951ca35bdb RISC-V: jal cannot refer to a default visibility symbol for shared object. [PR 108339]
This is the original binutils bugzilla report,
https://sourceware.org/bugzilla/show_bug.cgi?id=28509

And this is the first version of the proposed binutils patch,
https://sourceware.org/pipermail/binutils/2021-November/118398.html

After applying the binutils patch, I get the the unexpected error when
building libgcc,

/scratch/nelsonc/riscv-gnu-toolchain/riscv-gcc/libgcc/config/riscv/div.S:42:
/scratch/nelsonc/build-upstream/rv64gc-linux/build-install/riscv64-unknown-linux-gnu/bin/ld: relocation R_RISCV_JAL against `__udivdi3' which may bind externally can not be used when making a shared object; recompile with -fPIC

Therefore, this patch add an extra hidden alias symbol for __udivdi3, and
then use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.
The solution is similar to glibc as follows,
https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b

libgcc/ChangeLog:

	PR target/108339
	* config/riscv/div.S: Add the hidden alias symbol for __udivdi3, and
	then use HIDDEN_JUMPTARGET to target it since it is non-preemptible.
	* config/riscv/riscv-asm.h: Added new macros HIDDEN_JUMPTARGET and
	HIDDEN_DEF.

(cherry picked from commit 45116f3420)
2023-02-20 19:03:43 +08:00
Jim Wilson
d465a40200 RISC-V: Make __divdi3 handle div by zero same as hardware.
The ISA manual specifies that divide by zero always returns -1 as the result.
We were failing to do that when the dividend was negative.

Original patch from Virginie Moser.

	libgcc/
	* config/riscv/div.S (__divdi3): For negative arguments, change bgez
	to bgtz.

(cherry picked from commit 4013baf99c)
2023-02-20 19:03:42 +08:00
GCC Administrator
18d3492ff1 Daily bump. 2022-09-20 00:19:30 +00:00
Georg-Johann Lay
848ddecfe1 Fix PR target/99184: Wrong cast from double to 16-bit and 32-bit ints
this patch fixed PR target/99184 which incorrectly rounded during 64-bit
(long) double to 16-bit and 32-bit integers.

The patch just removes the respective roundings from
libf7-asm.sx::to_integer and ::to_unsigned.  Luckily, LibF7 does nowhere
use respective functions internally, the only user is in libf7.c::f7_exp

which reads

   f7_round (qq, qq);
   int16_t q = f7_get_s16 (qq);

so that f7_get_s16() operates on an already rounded value, and therefore
this code works unaltered with or without rounding in to_integer.

	PR target/99184
libgcc/config/avr/libf7/
	* libf7-asm.sx (to_integer, to_unsigned): Don't round 16-bit
	and 32-bit integers.

(cherry picked from commit 0b5b8ac5cb)
2022-09-19 09:53:00 +02:00
Jakub Jelinek
7ff47281ce Update ChangeLog and version files for release 2022-06-28 08:37:18 +00:00
GCC Administrator
9ef03b0a42 Daily bump. 2022-05-30 00:17:28 +00:00
Iain Sandoe
bf41b26f58 Darwin: Rework handling for unwinder code in libgcc_s and specs [PR80556].
This addresses a long-standing problem where a work-around for an unwinder
issue (also a regression) regresses other functionality.  The patch replaces
several work-arounds with a fix for PR80556 and a work-around for PR88590.

* The fix for PR80556 requires a bump to the SO name for libgcc_s, since we
need to remove the unwinder symbols from it.  This would trigger PR88590
hence the work-around for that.

* We weaken the symbols for emulated TLS support so that it is possible
for a DSO linked with static-libgcc to interoperate with a DSO linked with
libgcc_s.  Likewise main exes.

* We remove all the gcc-4.2.1 era stubs machinery and workarounds.

* libgcc is always now linked ahead of libc, which avoids fails where the
libc (libSystem) builtins implementations are not up to date.

* The unwinder now always comes from the system
 - for Darwin9 from /usr/lib/libgcc_s.1.dylib
 - for Darwin10 from /usr/lib/libSystem.dylib
 - for Darwin11+ from /usr/lib/system/libunwind.dylib.

 We still insert a shim on Darwin10 to fix an omitted unwind function, but
 the underlying unwinder remains the system one.

* The work-around for PR88590 has two parts (1) we always link libgcc from
its convenience lib on affected system versions (avoiding the need to find
the DSO path); (2) we add and export the emutls functions from DSOs - this
makes a relatively small (20k) addition to a DSO.  These can be backed out
when a proper fix for PR88590 is committed.

For distributions that wish to install a libgcc_s.1.dylib to satisfy linkage
from exes that linked against the stubs can use a reexported libgcc_s.1.1
(since that contains all the symbols that were previously exported via the
 stubs).

The replacement libgcc_s.1 forwards the symbols from the new SO.
In order to support DYLD_LIBRARY_PATH on systems (where it works)
we forward the libSystem unwinder symbols from 10.7+ and a
compiler-local version of the libgcc unwinder on earlier.

For macOS 10.4 to 10.6 this is 'bug-compatible' with existing uses.
For 10.7+ the behaviour will now actually be correct.

Backported from commits d4943ce939,
7add7f7bb3,
b504917e43,
32731fa5b0,
574c09da48 and
c18ddb05b0

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

gcc/ChangeLog:

	PR target/80556
	* config/darwin-driver.c (darwin_driver_init): Handle exported
	symbols and symbol lists (suppress automatic export of the TLS
	symbols).
	* config/darwin.c (darwin_rename_builtins): Remove workaround.
	* config/darwin.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise.
	(REAL_LIBGCC_SPEC): Handle revised library uses.
	* config/darwin.opt (nodefaultexport): New.
	* config/i386/darwin.h (PR80556_WORKAROUND): Remove.
	* config/i386/darwin32-biarch.h (PR80556_WORKAROUND): Likewise.
	* config/i386/darwin64-biarch.h (PR80556_WORKAROUND): Likewise.

libgcc/ChangeLog:

	* config.host: Add weak emutls crt to the extra_parts.
	(*-*-darwin*): Add logic to build a shared unwinder library for
	Darwin8-10.  Add shim declaration header to powerpc*-darwin builds.
	* config/i386/darwin-lib.h (DECLARE_LIBRARY_RENAMES): Remove
	workaround.
	* config/libgcc-libsystem.ver: Add exclude list for the system-
	provided unwinder.
	* config/t-slibgcc-darwin: Bump SO version, remove stubs code.
	Build a legacy libgcc_s.1 and the supporting pieces (all FAT libs).
	* config/t-darwin-ehs: Add dependencies to the shared unwinder
	objects.  Add dependency on unwind.h.
	* config/t-darwin: Reorganise the EH fragments to place them for
	inclusion in a shared EH lib.  Add libgcc_tm.h to the dependencies
	for darwin10-unwind-find-enc-func.
	* config/i386/libgcc-darwin.10.4.ver: Removed.
	* config/i386/libgcc-darwin.10.5.ver: Removed.
	* config/rs6000/libgcc-darwin.10.4.ver: Removed.
	* config/rs6000/libgcc-darwin.10.5.ver: Removed.
	* config/i386/t-darwin: Build legacy libgcc_s.1.
	* config/rs6000/t-darwin: Likewise.
	* config/rs6000/t-darwin-ehs: Remove dependency on the powerpc end
	file.  Add darwin-fallback.o.

gcc/testsuite/ChangeLog:

	* gcc.dg/torture/fp-int-convert-timode-3.c: Remove XFAIL.
	* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
2022-05-29 20:12:12 +01:00
Iain Sandoe
dbdaf3fa2d libgcc, emutls: Allow building weak definitions of the emutls functions.
In order to better support use of the emulated TLS between objects with
DSO dependencies and static-linked libgcc, allow a target to make weak
definitions.

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

libgcc/ChangeLog:

	* config/t-darwin: Build weak-defined emutls objects.
	* emutls.c (__emutls_get_address): Add optional attributes.
	(__emutls_register_common): Likewise.
	(EMUTLS_ATTR): New.

(cherry picked from commit b9873b4e2c)
2022-05-29 20:11:49 +01:00
Iain Sandoe
e1533cab24 Darwin, crts: Build Darwin10 unwinder shim as a library.
We have a small unwinder shim that is only used for Darwin10
(and only then in quite specific cases).  To avoid linking
this code for every executable or DSO, we can present the crt
as a convenience library (rather than a .o file).

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

gcc/ChangeLog:

	* config/darwin.h (LINK_COMMAND_SPEC_A): Use Darwin10
	unwinder shim as a convenience library.

libgcc/ChangeLog:

	* config.host: Use convenience library for Darwin10
	unwinder shim.
	* config/t-darwin: Build Darwin10 unwinder shim as a
	convenience library.

(cherry picked from commit 8738543878)
2022-05-29 20:10:49 +01:00
GCC Administrator
1c0e509c1a Daily bump. 2022-05-17 00:17:24 +00:00
Sebastian Pop
90a0a53153 add barriers to ool __sync builtins
2022-05-13  Sebastian Pop  <spop@amazon.com>

gcc/
	PR target/105162
	* config/aarch64/aarch64-protos.h (atomic_ool_names): Increase dimension
	of str array.
	* config/aarch64/aarch64.c (aarch64_atomic_ool_func): Call
	memmodel_from_int and handle MEMMODEL_SYNC_*.
	(DEF0): Add __aarch64_*_sync functions.

gcc/testsuite/
	PR target/105162
	* gcc.target/aarch64/sync-comp-swap-ool.c: New.
	* gcc.target/aarch64/sync-op-acquire-ool.c: New.
	* gcc.target/aarch64/sync-op-full-ool.c: New.
	* gcc.target/aarch64/target_attr_20.c: Update check.
	* gcc.target/aarch64/target_attr_21.c: Same.

libgcc/
	PR target/105162
	* config/aarch64/lse.S: Define BARRIER and handle memory MODEL 5.
	* config/aarch64/t-lse: Add a 5th memory model for _sync functions.
2022-05-16 14:39:41 +00:00
GCC Administrator
60f03833cb Daily bump. 2022-02-14 00:17:20 +00:00
Alan Modra
56e29facc4 [POWER10] __morestack calls from pcrel code
Compiling gcc/testsuite/gcc.dg/split-*.c and others with -mcpu=power10
and linking with a non-pcrel libgcc results in crashes due to the
power10 pcrel code not having r2 set for the generic-morestack.c
functions called from __morestack.  There is also a problem when
non-pcrel code calls a pcrel libgcc.  See the patch comments.

A similar situation theoretically occurs with ELFv1 multi-toc
executables, when __morestack might be located in a different toc
group to its caller.  This patch makes no attempt to fix that, since
the gold linker does not support multi-toc (gold is needed for proper
support of -fsplit-stack code) nor does gcc emit __morestack calls
that support multi-toc.

	* config/rs6000/morestack.S (R2_SAVE): Define.
	(__morestack): Save and restore r2.  Set up r2 for called
	functions.

(cherry picked from commit cd6ca96f5d)
2022-02-13 20:45:15 +10:30
Alan Modra
445922b932 [RS6000] Adjust gcc asm for power10
Generate assembly with .localentry,1 functions using @notoc calls.
This patch makes libgcc.a asm look the same as power10 pcrel as far as
toc/notoc is concerned.

Otherwise calling between functions that advertise as using the TOC
and those that don't, will require linker call stubs in statically
linked code.

gcc/
	* config/rs6000/ppc-asm.h: Support __PCREL__ code.
libgcc/
	* config/rs6000/morestack.S,
	* config/rs6000/tramp.S: Support __PCREL__ code.
libitm/
	* config/powerpc/sjlj.S: Support __PCREL__ code.

(cherry picked from commit 2dd7b93778)
2022-02-13 20:45:15 +10:30
GCC Administrator
c567d05a42 Daily bump. 2021-10-28 00:17:40 +00:00
John David Anglin
7bc932641a Fix warnings building linux-atomic.c and fptr.c on hppa64-linux
The file fptr.c is specific to 32-bit hppa-linux and should not be
included in LIB2ADD on hppa64-linux.

There is a builtin type mismatch in linux-atomic.c using the type
long long unsigned int for 64-bit atomic operations on hppa64-linux.

2021-10-27  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

	* config.host (hppa*64*-*-linux*): Don't add pa/t-linux to
	tmake_file.
	* config/pa/linux-atomic.c: Define u8, u16 and u64 types.
	Use them in FETCH_AND_OP_2, OP_AND_FETCH_2, COMPARE_AND_SWAP_2,
	SYNC_LOCK_TEST_AND_SET_2 and SYNC_LOCK_RELEASE_1 macros.
	* config/pa/t-linux64 (LIB1ASMSRC): New define.
	(LIB1ASMFUNCS): Revise.
	(HOST_LIBGCC2_CFLAGS): Add "-DLINUX=1".
2021-10-27 18:02:49 +00:00
GCC Administrator
64071734ed Daily bump. 2021-09-01 00:17:46 +00:00
Richard Sandiford
9346363325 libgcc: Add missing runtime exception notices
Quoting from https://gcc.gnu.org/pipermail/gcc/2021-July/236716.html:

--------------------------------------------------------------------
It was pointed out to me off-list that config/aarch64/value-unwind.h
is missing the runtime exception.  It looks like a few other files
are too; a fuller list is:

libgcc/config/aarch64/value-unwind.h
libgcc/config/frv/frv-abi.h
libgcc/config/i386/value-unwind.h
libgcc/config/pa/pa64-hpux-lib.h

Certainly for the aarch64 file this was simply a mistake;
it seems to have been copied from the i386 version, both of which
reference the runtime exception but don't actually include it.
--------------------------------------------------------------------

Similarly, frv-abi.h referenced the exception but didn't include it.
pa64-hpux-lib.h was missing any reference to the exception.

The decision was that this was simply a mistake
[https://gcc.gnu.org/pipermail/gcc/2021-July/236717.html]:

--------------------------------------------------------------------
[…] It generally is
considered a textual omission.  The runtime library components of GCC
are intended to be licensed under the runtime exception, which was
granted and approved at the time of introduction.
--------------------------------------------------------------------

and that we should simply change all of the files above
[https://gcc.gnu.org/pipermail/gcc/2021-July/236719.html]:

--------------------------------------------------------------------
Please correct the text in the files. The files in libgcc used in the
GCC runtime are intended to be licensed with the runtime exception and
GCC previously was granted approval for that licensing and purpose.

[…]

The runtime exception explicitly was intended for this purpose and
usage at the time that GCC received approval to apply the exception.
--------------------------------------------------------------------

libgcc/
	* config/aarch64/value-unwind.h: Add missing runtime exception
	paragraph.
	* config/frv/frv-abi.h: Likewise.
	* config/i386/value-unwind.h: Likewise.
	* config/pa/pa64-hpux-lib.h: Likewise.

(cherry picked from commit de7a795c32)
2021-08-31 10:58:26 +01:00
GCC Administrator
a70496de88 Daily bump. 2021-08-25 00:17:46 +00:00
Richard Earnshaw
a6db929252 arm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]
Add the recommended erratum mitigation sequence to
__gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this
is in the library code we cannot know in advance whether the core we
are running on will be affected by this, so always enable it.

libgcc:
	PR target/102035
	* config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call):
	Add vlldm erratum work-around.
(cherry picked from commit 574e7950bd)
2021-08-24 14:30:07 +01:00
GCC Administrator
ee82dba392 Daily bump. 2021-06-19 00:17:28 +00:00
Srinath Parvathaneni
0fd8e3ac9d arm: Fix the mve multilib for the broken cmse support (pr99939).
The current CMSE support in the multilib build for
"-march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=auto" is broken
as specified in PR99939 and this patch fixes the issue.

gcc/testsuite/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/99939
	* gcc.target/arm/cmse/cmse-18.c: Add separate scan-assembler
	directives check for target is v8.1-m.main+mve or not before
	comparing the assembly output.
	* gcc.target/arm/cmse/cmse-20.c: New test.

libgcc/ChangeLog:

2021-06-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/99939
	* config/arm/cmse_nonsecure_call.S: Add	__ARM_FEATURE_MVE
	macro.
	* config/arm/t-arm: To link cmse.o and cmse_nonsecure_call.o
	on passing -mcmse option.

(cherry picked from commit c5ed014834)
2021-06-18 13:26:30 +01:00
GCC Administrator
83ee7992ed Daily bump. 2021-04-28 00:17:22 +00:00
Michael Meissner
a633f7f96d [PATCH] Backport fix for PR target/98952
The test in the PowerPC 32-bit trampoline support is backwards.  It aborts
if the trampoline size is greater than the expected size.  It should abort
when the trampoline size is less than the expected size.  I fixed the test
so the operands are reversed.  I then folded the load immediate into the
compare instruction.

I verified this by creating a 32-bit trampoline program and manually
changing the size of the trampoline to be 48 instead of 40.  The program
aborted with the larger size.  I updated this code and ran the test again
and it passed.

I added a test case that runs on PowerPC 32-bit Linux systems and it calls
the __trampoline_setup function with a larger buffer size than the
compiler uses.  The test is not run on 64-bit systems, since the function
__trampoline_setup is not called.  I also limited the test to just Linux
systems, in case trampolines are handled differently in other systems.

libgcc/
2021-04-26  Michael Meissner  <meissner@linux.ibm.com>

	PR target/98952
	* config/rs6000/tramp.S (__trampoline_setup, elfv1 #ifdef): Fix
	trampoline size comparison in 32-bit by reversing test and
	combining load immediate with compare.  Fix backported from trunk
	change on 4/23, 886b6c1e8a.
	(__trampoline_setup, elfv2 #ifdef): Fix trampoline size comparison
	in 32-bit by reversing test and combining load immediate with
	compare.

gcc/testsuite/
2021-04-26  Michael Meissner  <meissner@linux.ibm.com>

	PR target/98952
	* gcc.target/powerpc/pr98952.c: New test.  Test backported from
	trunk change on 4/23, 886b6c1e8a.
2021-04-26 22:45:02 -04:00
GCC Administrator
411caeee36 Daily bump. 2021-04-21 00:17:12 +00:00
Jakub Jelinek
8642b73a0f rs6000: Fix up libgcc ABI when built with --with-long-double-format=ieee [PR97653]
__floatunditf and __fixtfdi and a couple of other libgcc{.a,_s.so}
entrypoints for backwards compatibility should mean IBM double double
handling (i.e. IFmode), gcc emits such calls for that format and
form IEEE long double emits *kf* instead.
When gcc is configured without --with-long-double-format=ieee ,
everything is fine, but when it is not, we need to compile those
libgcc sources with -mno-gnu-attribute -mabi=ibmlongdouble.
The following snippet in libgcc/config/rs6000/t-linux was attempting
to ensure that, and for some routines it works fine (e.g. for _powitf2).
But, due to 4 different types of bugs it doesn't work for most of those
functions, which means that in --with-long-double-format=ieee
configured gcc those *tf* entrypoints instead handle the long double
arguments as if they were KFmode.

The bugs are:
1) the first few objs properly use $(objext) as suffix, but
   several other contain a typo and use $(object) instead,
   which is a variable that isn't set to anything, so we don't
   add .o etc. extensions
2) while unsigned fix are properly called _fixuns*, unsigned float
   are called _floatun* (without s), but the var was using there
   the extra s and so didn't match
3) the variable didn't cover any of the TF <-> TI conversions,
   only TF <-> DI conversions
4) nothing in libgcc_s.so was handled, as those object files are
   called *_s.o rather than *.o and IBM128_SHARED_OBJS used wrong
   syntax of the GNU make substitution reference, which should be
   $(var:a=b) standing for $(patsubst a,b,$(var)) but it used
   $(var🅰️b) instead

2021-04-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/97653
	* config/rs6000/t-linux (IBM128_STATIC_OBJS): Fix spelling, use
	$(objext) instead of $(object).  Use _floatunditf instead of
	_floatunsditf.  Add tf <-> ti conversion objects.
	(IBM128_SHARED_OBJS): Use proper substitution reference syntax.

(cherry picked from commit cda41ce0e8)
2021-04-20 11:44:15 +02:00
Richard Biener
f00b5710a3 Update ChangeLog and version files for release 2021-04-08 11:56:48 +00:00
GCC Administrator
c50af57a1c Daily bump. 2021-04-01 00:17:34 +00:00
Jan Hubicka
54b273e320 Backport Zen3 tuning from mainline
Backport initial Zen3 support by Venkataramanan Kumar and Sharavan Kumar

gcc/ChangeLog:

	* common/config/i386/i386-common.c: Add znver3.
	* common/config/i386/i386-cpuinfo.h (enum processor_types): Add
	AMDFAM19H
	(enum processor_subtypes): Add AMDFAM19H_ZNVER3.
	(processor_alias_table): Add znver3 and AMDFAM19H entry.
	* common/config/i386/i386-cpuinfo.h (processor_types): Add
	AMDFAM19H.
	(processor_subtypes): AMDFAM19H_ZNVER3.
	* config.gcc (i[34567]86-*-linux* | ...): Likewise.
	* config/i386/driver-i386.c: (host_detect_local_cpu): Let
	-march=native recognize znver3 processors.
	* config/i386/i386-c.c (ix86_target_macros_internal): Add
	znver3.
	* config/i386/i386-options.c (m_znver3): New definition.
	(m_ZNVER): Include m_znver3.
	(processor_cost_table): Add znver3.
	* config/i386/i386.c (ix86_reassociation_width): Likewise.
	* config/i386/i386.h (TARGET_znver3): New definition.
	(enum processor_type): Add PROCESSOR_ZNVER3.
	* config/i386/i386.md (define_attr "cpu"): Add znver3.
	* config/i386/x86-tune-sched.c: (ix86_issue_rate): Likewise.
	(ix86_adjust_cost): Likewise.
	* config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS):
	Likewise.
	* config/i386/znver1.md: Add new reservations for znver3.
	* doc/extend.texi: Add details about znver3.
	* doc/invoke.texi: Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/funcspec-56.inc: Handle new march.

libgcc/ChangeLog:

	* config/i386/cpuinfo.c (get_amd_cpu): Support amdfam19.
	* config/i386/cpuinfo.h (enum processor_types): Add AMDFAM19H.
	(enum processor_subtypes): Add AMDFAM19H_ZNVER3.
2021-03-31 11:57:36 +02:00
GCC Administrator
ef729613cf Daily bump. 2021-02-25 00:17:10 +00:00
Christophe Lyon
fcfd5cc0f4 arm: Fix CMSE support detection in libgcc (PR target/99157)
As discussed in the PR, the Makefile fragment lacks a double '$' to
get the return-code from GCC invocation, resulting is CMSE support
missing from multilibs.

I checked that the simple patch proposed in the PR fixes the problem.

2021-02-23  Christophe Lyon  <christophe.lyon@linaro.org>
	    Hau Hsu  <hsuhau617@gmail.com>

	PR target/99157
	libgcc/
	* config/arm/t-arm: Fix cmse support detection.

(cherry picked from commit be30dd8992)
2021-02-24 16:02:44 +00:00
GCC Administrator
4d43c7649b Daily bump. 2021-01-22 00:17:12 +00:00
Michael Meissner
3531f987b2 PowerPC: Backport fix for libgcc long double support.
libgcc/
2021-01-20  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/t-linux (IBM128_STATIC_OBJS): Back port from
	master (12/3/2020).  New make variable.
	(IBM128_SHARED_OBJS): New make variable.
	(IBM128_OBJS): New make variable.  Set all objects to use the
	explicit IBM format, and disable gnu attributes.
	(IBM128_CFLAGS): New make variable.
	(gcc_s_compile): Add -mno-gnu-attribute to all shared library
	modules.
2021-01-20 20:36:56 -05:00
GCC Administrator
1e151fb435 Daily bump. 2021-01-14 00:17:09 +00:00
Samuel Thibault
2c4d3e6db8 hurd: libgcc unwinding over signal trampolines with SIGINFO
When the application sets SA_SIGINFO, the signal trampoline parameters
are different to follow POSIX.

	libgcc/
	* config/i386/gnu-unwind.h (x86_gnu_fallback_frame_state): Add the
	posix siginfo case to struct handler_args. Detect between legacy
	and siginfo from the second parameter, which is a small sigcode in
	the legacy case, and a pointer in the siginfo case.

(cherry picked from commit 2b356e689c)
2021-01-13 11:56:25 +01:00
GCC Administrator
7e31dbb706 Daily bump. 2020-10-03 00:17:01 +00:00
Sergei Trofimovich
b843d57c57 gcov: fix TOPN streaming from shared libraries
Before the change gcc did not stream correctly TOPN counters
if counters belonged to a non-local shared object.

As a result zero-section optimization generated TOPN sections
in a form not recognizable by '__gcov_merge_topn'.

The problem happens because in a case of multiple shared objects
'__gcov_merge_topn' function is present in address space multiple
times (once per each object).

The fix is to never rely on function address and predicate on TOPN
counter types.

libgcc/ChangeLog:

	PR gcov-profile/96913
	* libgcov-driver.c (write_one_data): Avoid function pointer
	comparison in TOP streaming decision.

(cherry picked from commit 4ecf368f4b)
2020-10-02 13:29:29 +01:00
GCC Administrator
52758e689a Daily bump. 2020-08-04 00:16:58 +00:00
Jakub Jelinek
fd2ec4542f aarch64: Fix up __aarch64_cas16_acq_rel fallback
As mentioned in the PR, the fallback path when LSE is unavailable writes
incorrect registers to the memory if the previous content compares equal
to x0, x1 - it writes copy of x0, x1 from the start of function, but it
should write x2, x3.

2020-08-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/96402
	* config/aarch64/lse.S (__aarch64_cas16_acq_rel): Use x2, x3 instead
	of x(tmp0), x(tmp1) in STXP arguments.

	* gcc.target/aarch64/pr96402.c: New test.

(cherry picked from commit 90b43856fd)
2020-08-03 22:57:59 +02:00
Richard Biener
ee5c3db6c5 Update ChangeLog and version files for release 2020-07-23 06:35:38 +00:00
GCC Administrator
13d817afed Daily bump. 2020-07-14 00:17:08 +00:00
Szabolcs Nagy
c24e8063ef libgcc: fix the handling of return address mangling [PR94891]
Mangling, currently only used on AArch64 for return address signing,
is an internal representation that should not be exposed via

  __builtin_return_address return value,
  __builtin_eh_return handler argument,
  _Unwind_DebugHook handler argument.

Note that a mangled address might not even fit into a void *, e.g.
with AArch64 ilp32 ABI the return address is stored as 64bit, so
the mangled return address cannot be accessed via _Unwind_GetPtr.

This patch changes the unwinder hooks as follows:

MD_POST_EXTRACT_ROOT_ADDR is removed: root address comes from
__builtin_return_address which is not mangled.

MD_POST_EXTRACT_FRAME_ADDR is renamed to MD_DEMANGLE_RETURN_ADDR,
it now operates on _Unwind_Word instead of void *, so the hook
should work when return address signing is enabled on AArch64 ilp32.
(But for that __builtin_aarch64_autia1716 should be fixed to operate
on 64bit input instead of a void *.)

MD_POST_FROB_EH_HANDLER_ADDR is removed: it is the responsibility of
__builtin_eh_return to do the mangling if necessary.

2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>

libgcc/ChangeLog:

	PR target/94891
	* config/aarch64/aarch64-unwind.h (MD_POST_EXTRACT_ROOT_ADDR): Remove.
	(MD_POST_FROB_EH_HANDLER_ADDR): Remove.
	(MD_POST_EXTRACT_FRAME_ADDR): Rename to ...
	(MD_DEMANGLE_RETURN_ADDR): This.
	(aarch64_post_extract_frame_addr): Rename to ...
	(aarch64_demangle_return_addr): This.
	(aarch64_post_frob_eh_handler_addr): Remove.
	* unwind-dw2.c (uw_update_context): Demangle return address.
	(uw_frob_return_addr): Remove.

(cherry picked from commit b097c7a27f)
2020-07-13 19:11:31 +01:00