Commit Graph

1198 Commits

Author SHA1 Message Date
Jakub Jelinek 811a475ea3 arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615]
As the following testcase shows, unwind.h on ARM can't be (starting with GCC
10) compiled with -std=c* modes, only -std=gnu* modes.
The problem is it uses asm keyword, which isn't a keyword in those modes
(system headers vs. non-system ones don't make a difference here).
glibc and other installed headers use __asm or __asm__ keywords instead that
work fine in both standard and gnu modes.

While there, as it is an installed header, I think it is also wrong to
completely ignore any identifier namespace rules.
The generic unwind.h defines just _Unwind* namespace identifiers plus
_sleb128_t/_uleb128_t (but e.g. unlike libstdc++/glibc headers doesn't
uglify operand names), the ARM unwind.h is much worse here.  I've just
changed the gnu_Unwind_Find_got function at least not be in user identifier
namespace, but perhaps it would be good to go further and rename e.g.
or e.g.
  typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State,
      _Unwind_Control_Block *, _Unwind_Context *);
in unwind-arm-common.h.

2020-02-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/93615
	* config/arm/unwind-arm.h (gnu_Unwind_Find_got): Rename to ...
	(_Unwind_gnu_Find_got): ... this.  Use __asm instead of asm.  Remove
	trailing :s in asm.  Formatting fixes.
	(_Unwind_decode_typeinfo_ptr): Adjust caller.

	* gcc.dg/pr93615.c: New test.
2020-02-07 11:01:14 +01:00
Sandra Loosemore 2d33dcfe9f nios2: Support for GOT-relative DW_EH_PE_datarel encoding.
On nios2-linux-gnu, there has been a long-standing bug in C++ exception
handling that sometimes resulted in link errors like

../nios2-linux-gnu/bin/ld: FDE encoding in /tmp/cccfpQ2l.o(.eh_frame) prevents .eh_frame_hdr table being created

when building some shared libraries or PIE executables.  The root of
the problem is that GCC was incorrectly emitting an absolute encoding
in EH tables for PIC.  This patch changes it to use either
DW_EH_PE_indirect (for global) or DW_EH_PE_datarel (for local), and
fixes libgcc so it can find the address of the GOT as the base address
for DW_EH_PE_datarel.

Complicating matters somewhat, GAS was missing support for
%gotoff(symbol) relocation syntax.  I have just pushed a fix for that,
but I've added a configure check to test for presence of the binutils
support and fall back to the current absolute encoding (which works
most of the time) if it is not available.  Once the fix makes it into
an official binutils release it might be appropriate to make this
error out instead.

Since this is a wrong-code bug and affects only nios2 target, I think
this is appropriate for Stage 4.  I regression-tested on both
nios2-linux-gnu and nios2-elf, with and without the binutils support
present, before committing this.

2020-01-31  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* configure.ac [nios2-*-*]: Check HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	* config.in: Regenerated.
	* configure: Regenerated.
	* config/nios2/nios2.h (ASM_PREFERRED_EH_DATA_FORMAT): Fix handling
	for PIC when HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.

	gcc/testsuite/
	* g++.target/nios2/hello-pie.C: New.
	* g++.target/nios2/nios2.exp: New.

	libgcc/
	* config.host [nios2-*-linux*] (tmake_file, tm_file): Adjust.
	* config/nios2-elf-lib.h: New.
	* unwind-dw2-fde-dip.c (_Unwind_IteratePhdrCallback): Use existing
	code for finding GOT base for nios2.
2020-01-31 16:46:50 -08:00
Martin Liska 3ae37f9297
Add __gcov_indirect_call_profiler_v4_atomic.
PR gcov-profile/93403
	* tree-profile.c (gimple_init_gcov_profiler): Generate
	both __gcov_indirect_call_profiler_v4 and
	__gcov_indirect_call_profiler_v4_atomic.
	PR gcov-profile/93403
	* libgcov-profiler.c (__gcov_indirect_call_profiler_v4):
	Call __gcov_indirect_call_profiler_body.
	(__gcov_indirect_call_profiler_body): New.
	(__gcov_indirect_call_profiler_v4_atomic): New.
	* libgcov.h (__gcov_indirect_call_profiler_v4_atomic):
	New declaration.
2020-01-27 16:20:10 +01:00
Claudiu Zissulescu 2744b8b286 [ARC] Make libgcc compatible with ARC's reduced register set config.
ARC processors can work with a reduced register set (i.e. registers
r4-r9 and r16-r25 are not available). This option can be enabled
passing -mrf16 option to the compiler, or by using -mcpu=em_mini CPU
configuration. Using RF16 config requires all the hand-made assembly
files used in libgcc to have the corresponding RF16 object attribute
set.

This patch qualifies the relevant hand-made assembly files to
RF16 config, and also adds generic c-functions for the one which are
not.

libgcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/crti.S: Add RF16 object attribute.
	* config/arc/crtn.S: Likewise.
	* config/arc/crttls.S: Likewise.
	* config/arc/lib1funcs.S: Likewise.
	* config/arc/fp-hack.h (ARC_OPTFPE): Define.
	* config/arc/lib2funcs.c: New file.
	* config/arc/t-arc: Add lib2funcs to LIB2ADD.
2020-01-27 14:51:03 +02:00
Maciej W. Rozycki e8e66971cd Add `--with-toolexeclibdir=' configuration option
Provide means, in the form of a `--with-toolexeclibdir=' configuration
option, to override the default installation directory for target
libraries, otherwise known as $toolexeclibdir.  This is so that it is
possible to get newly-built libraries, particularly the shared ones,
installed in a common place, so that they can be readily used by the
target system as their host libraries, possibly over NFS, without a need
to manually copy them over from the currently hardcoded location they
would otherwise be installed in.

In the presence of the `--enable-version-specific-runtime-libs' option
and for configurations building native GCC the option is ignored.

	config/
	* toolexeclibdir.m4: New file.

	gcc/
	* doc/install.texi (Cross-Compiler-Specific Options): Document
	`--with-toolexeclibdir' option.

	libada/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libatomic/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libffi/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libgcc/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libgfortran/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libgomp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libhsail-rt/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libitm/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libobjc/
	* Makefile.in (aclocal_deps): Add `toolexeclibdir.m4'.
	* aclocal.m4: Include `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	liboffloadmic/
	* plugin/configure.ac: Handle `--with-toolexeclibdir='.
	* plugin/Makefile.in: Regenerate.
	* plugin/aclocal.m4: Regenerate.
	* plugin/configure: Regenerate.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libphobos/
	* m4/druntime.m4: Handle `--with-toolexeclibdir='.
	* m4/Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libquadmath/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libsanitizer/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

	libssp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libvtv/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	zlib/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2020-01-24 11:24:25 +00:00
Dragan Mladjenovic 54b3d52c3c Emit .note.GNU-stack for hard-float linux targets.
libgcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also.

gcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config.in: Regenerated.
	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to 1
	for TARGET_LIBC_GNUSTACK.
	* configure: Regenerated.
	* configure.ac: Define TARGET_LIBC_GNUSTACK if glibc version is
	found to be 2.31 or greater.
2020-01-23 17:00:03 +01:00
Dragan Mladjenovic a3c1e1f2ff Emit .note.GNU-stack for soft-float linux targets.
gcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to
	TARGET_SOFT_FLOAT.
	* config/mips/mips.c (TARGET_ASM_FILE_END): Define to ...
	(mips_asm_file_end): New function. Delegate to
	file_end_indicate_exec_stack if NEED_INDICATE_EXEC_STACK is true.
	* config/mips/mips.h (NEED_INDICATE_EXEC_STACK): Define to 0.

libgcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/gnustack.h: New file.
	* config/mips/crti.S: Include gnustack.h.
	* config/mips/crtn.S: Likewise.
	* config/mips/mips16.S: Likewise.
	* config/mips/vr4120-div.S: Likewise.
2020-01-23 17:00:02 +01:00
Martin Liska e9ee848dcd
Remove wrong bail out in prune_topn_counter.
* libgcov-driver.c (prune_topn_counter): Remove
	check for -1 as we only prune run-time counters
	that do not generate an invalid state.
2020-01-23 14:34:59 +01:00
Martin Liska 7491c17fe0
Fix TOP N counter update.
PR tree-optimization/92924
	* libgcov-profiler.c (__gcov_topn_values_profiler_body): First
	try to find an existing value, then find an empty slot
	if not found.
2020-01-22 13:40:12 +01:00
Martin Liska 5f32f9cf13
Smart relaxation of TOP N counter.
PR tree-optimization/92924
	* profile.c (compute_value_histograms): Divide
	all counter values.
	PR tree-optimization/92924
	* libgcov-driver.c (prune_topn_counter): New.
	(prune_counters): Likewise.
	(dump_one_gcov): Prune a run-time counter.
	* libgcov-profiler.c (__gcov_topn_values_profiler_body):
	For a known value, add GCOV_TOPN_VALUES to value.
	Otherwise, decrement all counters by one.
2020-01-22 12:08:11 +01:00
Hans-Peter Nilsson 463f649944 libgcc: cris: config/cris/arit.c (DS): Apply attribute __fallthrough__.
* config/cris/arit.c (DS): Apply attribute fallthrough.

Without this, there are, for each compilation of arit.c, 30ish
occurrences of "this statement may fall through
[-Wimplicit-fallthrough=]", for lines that look like
    case 32: DS; case 31: DS; case 30: DS; case 29: DS;
2020-01-18 16:38:56 +01:00
John David Anglin 84479e3a4c Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false
PR libgcc/92988
	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
	DEFAULT_USE_CXA_ATEXIT is true.
2020-01-18 10:30:29 -05:00
Jakub Jelinek 674dcc3f73 Fix up ChangeLog. 2020-01-17 19:45:35 +01:00
Mihail Ionescu e953433f08 [PATCH, GCC/ARM, 1/10] Fix -mcmse check in libgcc
This patch is part of a patch series to add support for Armv8.1-M
Mainline Security Extensions architecture.

Code to detect whether cmse.c can be buit with -mcmse checks the output
of host GCC when invoked with -mcmse. However, an error from the
compiler does not prevent some minimal output so this always holds true.

2020-01-16  Mihail-Calin Ionescu  <mihail.ionescu@arm.com>
2020-01-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* config/arm/t-arm: Check return value of gcc rather than lack of
	output.
2020-01-16 15:09:19 +00:00
Georg-Johann Lay 03e8772486 Typo.
libgcc/
	* config/avr/lib1funcs.S (skip): Simplify.
2020-01-14 11:14:23 +01:00
Kwok Cheung Yeung af9bd92015 [amdgcn] Remove dependency on stdint.h in libgcc
2020-01-10  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgcc/
	* config/gcn/atomic.c: Remove include of stdint.h.
	(__sync_val_compare_and_swap_##SIZE): Replace uintptr_t with
	__UINTPTR_TYPE__.

From-SVN: r280152
2020-01-10 23:19:41 +00:00
Kwok Cheung Yeung d6491d1567 [amdgcn] Add support for sub-word sync_compare_and_swap operations
2020-01-09  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgcc/
	* config/gcn/atomic.c: New.
	* config/gcn/t-amdgcn (LIB2ADD): Add atomic.c.

From-SVN: r280055
2020-01-09 15:35:14 +00:00
Georg-Johann Lay f30dd60766 Implement 64-bit double functions.
gcc/
	PR target/92055
	* config.gcc (tm_defines) [target=avr]: Support --with-libf7,
	--with-double-comparison.
	* doc/install.texi: Document them.
	* config/avr/avr-c.c (avr_cpu_cpp_builtins)
	<WITH_LIBF7_LIBGCC, WITH_LIBF7_MATH, WITH_LIBF7_MATH_SYMBOLS>
	<WITH_DOUBLE_COMPARISON>: New built-in defines.
	* doc/invoke.texi (AVR Built-in Macros): Document them.
	* config/avr/avr-protos.h (avr_float_lib_compare_returns_bool): New.
	* config/avr/avr.c (avr_float_lib_compare_returns_bool): New function.
	* config/avr/avr.h (FLOAT_LIB_COMPARE_RETURNS_BOOL): New macro.
libgcc/
	PR target/92055
	* config.host (tmake_file) [target=avr]: Add t-libf7,
	t-libf7-math, t-libf7-math-symbols as specified by --with-libf7=.
	* config/avr/t-avrlibc: Don't copy libgcc.a if there are modules
	depending on sizeof (double) or sizeof (long double).
	* config/avr/libf7: New folder.
libgcc/config/avr/libf7/
	PR target/92055
	* t-libf7: New file.
	* t-libf7-math: New file.
	* t-libf7-math-symbols: New file.
	* libf7-common.mk: New file.
	* libf7-asm-object.mk: New file.
	* libf7-c-object.mk: New file.
	* asm-defs.h: New file.
	* libf7.h: New file.
	* libf7.c: New file.
	* libf7-asm.sx: New file.
	* libf7-array.def: New file.
	* libf7-const.def: New file.
	* libf7-constdef.h: New file.
	* f7renames.sh: New script.
	* f7wraps.sh: New script.
	* f7-renames.h: New generated file.
	* f7-wraps.h: New generated file.

From-SVN: r279994
2020-01-08 09:31:07 +00:00
Olivier Hainque 5205a4456b Guard inclusion of vxAtomicLib.h from gthr-vxworks.h
2020-01-05  Olivier Hainque  <hainque@adacore.com>

        * config/gthr-vxworks.h: Guard #include vxAtomicLib.h
	by IN_LIBGCC2.

From-SVN: r279885
2020-01-05 12:45:54 +00:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Olivier Hainque abb6c3eecf Introduce an internal API for VxWorks version checks
This changes introduces an internal API for VxWorks version checks
within runtime files, a prerequisite to a few fixes coming up for libstdc++
builds on more recent versions of the OS.

2019-12-30  Olivier Hainque  <hainque@adacore.com>

	gcc/
	* config/vxworks/_vxworks-versions.h: New file.
	* config.gcc (*-*-vxworks*): Add it to extra_headers.

	libgcc/
	* config/gthr-vxworks.h: Use _vxworks-versions.h.
	* config/gthr-vxworks-tls.c: Likewise.

From-SVN: r279783
2019-12-30 21:42:26 +00:00
Olivier Hainque d7f5094aa3 Improve VxWorks GTHREAD_ONCE_INIT
2019-12-30  Olivier Hainque  <hainque@adacore.com>

	* config/gthr-vxworks.h (GTHREAD_ONCE_INIT): Use
	standard zero-initializer syntax.

From-SVN: r279776
2019-12-30 21:22:21 +00:00
Olivier Hainque 49cfaa2a71 Fix macro reference in gthr-vxworks-tls.c
2019-12-30  Olivier Hainque  <hainque@adacore.com>

	libgcc/
	* config/gthr-vxworks-tls.c (__gthread_getspecific): Fix
	reference to the internal VX_GET_TLS_DATA interface.

From-SVN: r279775
2019-12-30 21:14:35 +00:00
Olivier Hainque 89b9a55472 Fix typo in macro name guarding conditional in vxcrtstuff.c
2019-12-30  Olivier Hainque  <hainque@adacore.com>

	libgcc/
	* config/vxcrtstuff.c: Fix incorrect spelling of
	USE_INITFINI_ARRAY in guard.

From-SVN: r279774
2019-12-30 21:11:22 +00:00
Jozef Lawrynowicz e8aa9f55f6 MSP430: Add new msp430-elfbare target
contrib/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config-list.mk: Add msp430-elfbare.

gcc/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.gcc: s/msp430*-*-*/msp430-*-*.
	Handle msp430-*-elfbare.
	* config/msp430/msp430-devices.c (TARGET_SUBDIR): Define.
	(_MSPMKSTR): Define.
	(__MSPMKSTR): Define.
	(rest_of_devices_path): Use TARGET_SUBDIR value in string.
	* config/msp430/msp430.c (msp430_option_override): Error if
	-fuse-cxa-atexit is used when it has been disabled at configure time.
	* config/msp430/t-msp430: Define TARGET_SUBDIR when building
	msp430-devices.o.
	* doc/install.texi: Document msp430-*-elf and msp430-*-elfbare.
	* doc/invoke.texi: Update documentation about which path devices.csv is
	searched for.

gcc/testsuite/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* g++.dg/init/dso_handle1.C: Require cxa_atexit support.
	* g++.dg/init/dso_handle2.C: Likewise.
	* g++.dg/other/cxa-atexit1.C: Likewise.
	* gcc.target/msp430/msp430.exp: Update csv-using-installed.c test to
	handle msp430-elfbare configuration.

libgcc/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.host: s/msp430*-*-elf/msp430-*-elf*.
	Override default "extra_parts" variable.
	* configure: Regenerate.
	* configure.ac: Disable TM clone registry by default for
	msp430-elfbare.

From-SVN: r279442
2019-12-16 11:02:10 +00:00
Jozef Lawrynowicz a9046e9853 MSP430: Add -fno-exceptions multilib
ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config-ml.in (msp430-*-*): Support --disable-no-exceptions configure
	flag.

gcc/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.h (STARTFILE_SPEC) [!fexceptions]: Use
	crtbegin_no_eh.o if building for the C language.
	[fno-exceptions]: Use crtbegin_no_eh.o if building for any language
	except C.
	(ENDFILE_SPEC) [!fexceptions]: Use crtend_no_eh.o if building for 
	the C language.
	[fno-exceptions]: Use crtend_no_eh.o if building for any language
	except C.
	* config/msp430/t-msp430: Add -fno-exceptions multilib.
	* doc/install.texi: Document --disable-no-exceptions multilib configure
	option.
	* doc/sourcebuild.texi: Document exceptions_enabled effective target.

gcc/testsuite/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* lib/gcc-dg.exp: Add dg-prune messages for when exception handling is
	disabled.
	* lib/target-supports.exp (check_effective_target_exceptions_enabled):
	New.

libgcc/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.host: Add crt{begin,end}_no_eh.o to "extra_parts".
	* config.host (msp430*-*-elf): Add crt{begin,end}_no_eh.o to
	"extra_parts".

From-SVN: r279246
2019-12-11 19:19:50 +00:00
Jozef Lawrynowicz 34a53788fe libgcc: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is true
2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* crtstuff.c: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is
	true.

From-SVN: r279243
2019-12-11 18:59:38 +00:00
Jozef Lawrynowicz 21a098f4a1 libgcc: Fix misuse of USE_EH_FRAME_REGISTRY in crtstuff.c
2019-12-09  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* crtstuff.c (__do_global_dtors_aux): Check if USE_EH_FRAME_REGISTRY is
	defined instead of its value.

From-SVN: r279125
2019-12-09 12:35:55 +00:00
Jozef Lawrynowicz ad8b778345 libgcc: Dont define __do_global_dtors_aux if it will be empty
2019-12-09  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* crtstuff.c (__do_global_dtors_aux): Wrap in #if so it's only defined
	if it will have contents.

From-SVN: r279123
2019-12-09 11:41:07 +00:00
Georg-Johann Lay 08d7ff78b3 re PR target/92055 ([avr] Support 64-bit double)
PR target/92055
	* config/avr/t-avrlibc (MULTISUBDIR): Search for double, not double64.

From-SVN: r278992
2019-12-05 09:47:35 +00:00
Szabolcs Nagy 34b4d99d0c fix ChangeLog to reference the PR
From-SVN: r278403
2019-11-18 12:46:56 +00:00
Szabolcs Nagy 3d3a96a26e musl: Don't use gthr weak refs in libgcc PR91737
The gthr weak reference based single thread detection is unsafe with
static linking and in case of dynamic linking it's ineffective on musl
since pthread symbols are defined in libc.so.

(Ideally this should be fixed for all targets, since glibc plans to move
libpthread.so into libc.so too and users want to static link to pthread
without --whole-archive: PR87189.)

For now we have to explicitly opt out from the broken behaviour in the
config machinery of each target lib and libgcc was previously missed.

libgcc/ChangeLog:

2019-11-18  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config.host: Add t-gthr-noweak on *-*-musl*.
	* config/t-gthr-noweak: New file.

From-SVN: r278399
2019-11-18 12:08:18 +00:00
John David Anglin 632b5e3da7 linux-atomic.c (__kernel_cmpxchg): Change argument 1 to volatile void *.
* config/pa/linux-atomic.c (__kernel_cmpxchg): Change argument 1 to
	volatile void *.  Remove trap check.
	(__kernel_cmpxchg2): Likewise.
	(FETCH_AND_OP_2): Adjust operand types.
	(OP_AND_FETCH_2): Likewise.
	(FETCH_AND_OP_WORD): Likewise.
	(OP_AND_FETCH_WORD): Likewise.
	(COMPARE_AND_SWAP_2): Likewise.
	(__sync_val_compare_and_swap_4): Likewise.
	(__sync_bool_compare_and_swap_4): Likewise.
	(SYNC_LOCK_TEST_AND_SET_2): Likewise.
	(__sync_lock_test_and_set_4): Likewise.
	(SYNC_LOCK_RELEASE_1): Likewise.  Use __kernel_cmpxchg2 for release.
	(__sync_lock_release_4): Adjust operand types.  Use __kernel_cmpxchg
	for release.
	(__sync_lock_release_8): Remove.

From-SVN: r278377
2019-11-17 23:11:52 +00:00
Szabolcs Nagy 838fd641a6 m68k: add musl support
Add the dynamic linker name and fix a type name to use the public name
instead of the glibc internal name.

gcc/ChangeLog:

2019-11-15  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config/m68k/linux.h (MUSL_DYNAMIC_LINKER): Define.

libgcc/ChangeLog:

2019-11-15  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config/m68k/linux-unwind.h (struct uw_ucontext): Use sigset_t instead
	of __sigset_t.

From-SVN: r278312
2019-11-15 19:47:12 +00:00
Jerome Lambourg 27204060db Update the arm-*-vxworks* support
2019-11-13  Jerome Lambourg  <lambourg@adacore.com>
            Doug Rupp <rupp@adacore.com>
            Olivier Hainque  <hainque@adacore.com>

	gcc/
	* config.gcc: Collapse the arm-vxworks entries into
	a single arm-wrs-vxworks7* one, bpabi based.  Update
	the default cpu from arm8 to armv7-a
	* config/arm/vxworks.h (CC1_SPEC): Simplify, knowing that
	we always use ARM_UNWIND_INFO.
	(DWARF2_UNWIND_INFO): Remove redefinition.
	(ARM_TARGET2_DWARF_FORMAT): Likewise.
	(VXWORKS_PERSONALITY): Define, to "llvm".
	(VXWORKS_EXTRA_LIBS_RTP): Define, to "-lllvm".

	libgcc/
	* config.host: Collapse the arm-vxworks entries into
	a single arm-wrs-vxworks7* one.
	* config/arm/unwind-arm-vxworks.c: Update comments.  Provide
	__gnu_Unwind_Find_exidx and a weak dummy __cxa_type_match for
	kernel modules, to be overriden by libstdc++ when we link with
	it.  Rely on externally provided __exidx_start/end.

Co-Authored-By: Doug Rupp <rupp@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278253
2019-11-14 16:11:30 +00:00
Doug Rupp 3004f893b4 Base support for vxworks 7 on aarch64
2019-11-14  Doug Rupp  <rupp@adacore.com>
           Olivier Hainque  <hainque@adacore.com>
           Jerome Lambourg  <lambourg@adacore.com>

       gcc/
       * config.gcc: Handle aarch64*-wrs-vxworks7*.
       * config/aarch64/aarch64-vxworks.h: New file.
       * config/aarch64/t-aarch64-vxworks: New file.

       libgcc/
       * config.host: Handle aarch64*-wrs-vxworks7*.

Co-Authored-By: Jerome Lambourg <lambourg@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278251
2019-11-14 16:05:08 +00:00
Olivier Hainque 36e5f4d4f3 Update the libgcc support for VxWorks AE/653
2019-11-12  Olivier Hainque  <hainque@adacore.com>

	libgcc/

        * config/t-gthr-vxworksae: New file, add all the gthr-vxworks
        sources except the cxx0x support to LIB2ADDEH.  We don't support
        cxx0x on AE/653.
        * config/t-vxworksae: New file.

        * config.host: Handle *-*-vxworksae: Add the two aforementioned
	Makefile fragment files at their expected position in the tmake_file
	list, in accordance with what is done for other VxWorks variants.

From-SVN: r278250
2019-11-14 16:00:55 +00:00
Corentin Gay 806dd0472f Improve the thread support for VxWorks
2019-11-12  Corentin Gay  <gay@adacore.com>
	    Jerome Lambourg  <lambourg@adacore.com>
	    Olivier Hainque  <hainque@adacore.com>

	libgcc/

	* config/t-gthr-vxworks: New file, add all the gthr-vxworks
	sources to LIB2ADDEH.
	* config/t-vxworks: Remove adjustments to LIB2ADDEH.
	* config/t-vxworks7: Likewise.

	* config.host: Append a block at the end of the file to add the
	t-gthr files to the tmake_file list for VxWorks after everything
	else.

	* config/vxlib.c: Rename as gthr-vxworks.c.
	* config/vxlib-tls.c: Rename as gthr-vxworks-tls.c.

	* config/gthr-vxworks.h: Simplify a few comments.  Expose a TAS
	API and a basic error checking API, both internal.  Simplify the
	__gthread_once_t type definition and initializers.  Add sections
	for condition variables support and for the C++0x thread support,
	conditioned against Vx653 for the latter.

	* config/gthr-vxworks.c (__gthread_once): Simplify comments and
	implementation, leveraging the TAS internal API.
	* config/gthr-vxworks-tls.c: Introduce an internal TLS data access
	API, leveraging the general availability of TLS services in VxWorks7
	post SR6xxx.
	(__gthread_setspecific, __gthread_setspecific): Use it.
	(tls_delete_hook): Likewise, and simplify the enter/leave dtor logic.
	* config/gthr-vxworks-cond.c: New file.  GTHREAD_COND variable
	support based on VxWorks primitives.
	* config/gthr-vxworks-thread.c: New file.  GTHREAD_CXX0X support
	based on VxWorks primitives.

Co-Authored-By: Jerome Lambourg <lambourg@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278249
2019-11-14 15:58:31 +00:00
Jerome Lambourg 78e49fb1bc Introduce vxworks specific crtstuff support
2019-11-06  Jerome Lambourg  <lambourg@adacore.com>
            Olivier Hainque  <hainque@adacore.com>

	libgcc/
	* config/vxcrtstuff.c: New file.
	* config/t-vxcrtstuff: New Makefile fragment.
	* config.host: Append t-vxcrtstuff to the tmake_file list
	on all VxWorks ports using dwarf for table based EH.

	gcc/
	* config/vx-common.h (USE_TM_CLONE_REGISTRY): Remove
	definition, pointless with a VxWorks specific version
	of crtstuff.
	(DWARF2_UNWIND_INFO): Conditionalize on !ARM_UNWIND_INFO.
	* config/vxworks.h (VX_CRTBEGIN_SPEC, VX_CRTEND_SPEC):
	New local macros, controlling the addition of vxworks specific
	crtstuff objects depending on the EH mechanism and kind of
	module being linked.
	(VXWORKS_STARTFILE_SPEC, VXWORKS_ENDFILE_SPEC): Use them.

Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278248
2019-11-14 15:53:23 +00:00
Georg-Johann Lay 29f3def308 Support 64-bit double and 64-bit long double configurations.
gcc/
	Support 64-bit double and 64-bit long double configurations.

	PR target/92055
	* config.gcc (tm_defines) [avr]: Set from --with-double=,
	--with-long-double=.
	* config/avr/t-multilib: Remove.
	* config/avr/t-avr: Output of genmultilib.awk is now fully
	dynamically generated and no more part of the repo.
	(HAVE_DOUBLE_MULTILIB, HAVE_LONG_DOUBLE_MULTILIB): New variables.
	Pass them down to...
	* config/avr/genmultilib.awk: ...here and handle them.
	* gcc/config/avr/avr.opt (-mdouble=, avr_double). New option and var.
	(-mlong-double=, avr_long_double). New option and var.
	* common/config/avr/avr-common.c (opts.h, diagnostic.h): Include.
	(TARGET_OPTION_OPTIMIZATION_TABLE) <-mdouble=, -mlong-double=>:
	Set default as requested by --with-double=
	(TARGET_HANDLE_OPTION): Define to this...
	(avr_handle_option): ...new hook worker.
	* config/avr/avr.h (DOUBLE_TYPE_SIZE): Define to avr_double.
	(LONG_DOUBLE_TYPE_SIZE): Define to avr_long_double.
	(avr_double_lib): New proto for spec function.
	(EXTRA_SPEC_FUNCTIONS) <double-lib>: Add.
	(DRIVER_SELF_SPECS): Call %:double-lib.
	* config/avr/avr.c (avr_option_override): Assert
	sizeof(long double) >= sizeof(double) for the target.
	* config/avr/avr-c.c (avr_cpu_cpp_builtins)
	[__HAVE_DOUBLE_MULTILIB__, __HAVE_LONG_DOUBLE_MULTILIB__]
	[__HAVE_DOUBLE64__, __HAVE_DOUBLE32__, __DEFAULT_DOUBLE__=]
	[__HAVE_LONG_DOUBLE64__, __HAVE_LONG_DOUBLE32__]
	[__HAVE_LONG_DOUBLE_IS_DOUBLE__, __DEFAULT_LONG_DOUBLE__=]:
	New built-in define depending on --with-double=, --with-long-double=.
	* config/avr/driver-avr.c (avr_double_lib): New spec function.
	* doc/invoke.tex (AVR Options) <-mdouble=,-mlong-double=>: Doc.
	* doc/install.texi (Cross-Compiler-Specific Options)
	<--with-double=, --with-long-double=>: Doc.

libgcc/
	Support 64-bit double and 64-bit long double configurations.

	PR target/92055
	* config/avr/t-avr (HOST_LIBGCC2_CFLAGS): Only add -DF=SF if
	long double is a 32-bit type.
	* config/avr/t-avrlibc: Copy double64 and long-double64
	multilib(s) from the vanilla one.
	* config/avr/t-copy-libgcc: New Makefile snip.

From-SVN: r277908
2019-11-07 09:19:31 +00:00
Jozef Lawrynowicz 62ec242ea1 libgcc: Fix incorrect use of USE_TM_CLONE_REGISTRY
2019-11-04  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* crtstuff.c: Define USE_TM_CLONE_REGISTRY to 0 if it's undefined and
	the target output object format is not ELF.
	s/defined(USE_TM_CLONE_REGISTRY)/USE_TM_CLONE_REGISTRY.

From-SVN: r277775
2019-11-04 12:41:56 +00:00
Oleg Endo da5c1bbe97 re PR libgcc/78804 ([RX] -m64bit-doubles does not work)
libgcc/
	PR libgcc/78804
	* fp-bit.h: Remove FLOAT_BIT_ORDER_MISMATCH.
	* fp-bit.c (pack_d, unpack_d): Remove special cases for
	FLOAT_BIT_ORDER_MISMATCH.
	* config/arc/t-arc: Remove FLOAT_BIT_ORDER_MISMATCH.

From-SVN: r277752
2019-11-03 12:09:26 +00:00
Jim Wilson 8dc56a2244 RISC-V: Build soft-float divide routines for -mno-fdiv.
Using -mno-fdiv gives linker errors unless we build the missing divide
routines in libgcc always.  There is at least one university project
designing RISC-V parts without FP divide that wants to use the option.

	libgcc/
	* config/riscv/t-softfp32 (softfp_extra): Add FP divide routines

From-SVN: r277723
2019-11-01 13:35:12 -07:00
Jozef Lawrynowicz 91c64455e8 lib2hw_mul.S: Fix wrong syntax in branch instruction.
2019-10-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/lib2hw_mul.S: Fix wrong syntax in branch instruction.
	s/RESULT_LO/RESLO, s/RESULT_HI/RESHI, s/MPY_OP1/MPY, 
	s/MPY_OP1_S/MPYS, s/MAC_OP1/MAC, s/MPY_OP2/OP2, s/MAC_OP2/OP2.
	Define symbols for 32-bit and f5series hardware multiply
	register addresses.
	Replace hard-coded register addresses with symbols.
	Fix "_mspabi*" typo.
	Fix whitespace.
	* config/msp430/lib2mul.c: Add comment.

From-SVN: r277340
2019-10-23 16:52:47 +00:00
John David Anglin 85093ac6c9 fptr.c (_dl_read_access_allowed): Change argument to unsigned int.
* config/pa/fptr.c (_dl_read_access_allowed): Change argument to
	unsigned int.  Adjust callers.
	(__canonicalize_funcptr_for_compare): Change plabel type to volatile
	unsigned int *.  Load relocation offset before function pointer.
	Add barrier to ensure ordering.

From-SVN: r277015
2019-10-15 22:17:14 +00:00
John David Anglin 1aea083d4b lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
* config/pa/lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
	Load PIC register after branch target.  Fix white space.
	* config/pa/milli64.S ($$dyncall): Separate LINUX and non LINUX
	implementations.  Load PIC register after branch target.  Don't
	clobber function pointer when it points to function descriptor.
	Use nullification instead of branch in LINUX implementation.

From-SVN: r276925
2019-10-12 19:40:42 +00:00
John David Anglin c49af82c5f fptr.c: Disable -Warray-bounds warning.
* config/pa/fptr.c: Disable -Warray-bounds warning.

From-SVN: r276556
2019-10-03 23:51:42 +00:00
Richard Henderson 9e46fd072b libgcc: Rebuild autoconf files
* config.in, configure: Re-rebuild with stock autoconf 2.69,
        not the ubuntu modified 2.69.

From-SVN: r276135
2019-09-25 16:04:58 -07:00
Richard Henderson 58d169ba9f aarch64: Configure for sys/auxv.h in libgcc for lse-init.c
PR target/91833
	* config/aarch64/lse-init.c: Include auto-target.h.  Disable
	initialization if !HAVE_SYS_AUXV_H.
	* configure.ac (AC_CHECK_HEADERS): Add sys/auxv.h.
	* config.in, configure: Rebuild.

From-SVN: r276134
2019-09-25 15:51:55 -07:00
Richard Henderson 88a51d68c4 aarch64: Fix store-exclusive in load-operate LSE helpers
PR target/91834
	* config/aarch64/lse.S (LDNM): Ensure STXR output does not
	overlap the inputs.

From-SVN: r276133
2019-09-25 14:48:41 -07:00
Shaokun Zhang 761e6bb9f7 [AARCH64] Add support for new control bits CTR_EL0.DIC and CTR_EL0.IDC
The DCache clean & ICache invalidation requirements for instructions
to be data coherence are discoverable through new fields in CTR_EL0.
Let's support the two bits if they are enabled, the CPU core will
not execute the unnecessary DCache clean or Icache Invalidation
instructions.

2019-09-25  Shaokun Zhang  <zhangshaokun@hisilicon.com>

	* config/aarch64/sync-cache.c (__aarch64_sync_cache_range): Add support for
	CTR_EL0.IDC and CTR_EL0.DIC.

From-SVN: r276122
2019-09-25 12:38:59 +00:00
Christophe Lyon 76c93295f3 Revert [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
This is causing regressions when mixing with user code compiled in ARM mode.

2019-09-20  Christophe Lyon  <christophe.lyon@st.com>

	Revert:
	2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
		Mickaël Guêné <mickael.guene@st.com>

	* config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only
	architecture.

From-SVN: r276001
2019-09-20 15:32:20 +02:00
Richard Henderson 33befddcb8 aarch64: Add out-of-line functions for LSE atomics
This is the libgcc part of the interface -- providing the functions.
Rationale is provided at the top of libgcc/config/aarch64/lse.S.

	* config/aarch64/lse-init.c: New file.
	* config/aarch64/lse.S: New file.
	* config/aarch64/t-lse: New file.
	* config.host: Add t-lse to all aarch64 tuples.

From-SVN: r275967
2019-09-19 07:36:38 -07:00
Christophe Lyon 84818dbb70 [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
Without this, when we are unwinding across a signal frame we can jump
to an even address which leads to an exception.

This is needed in __gnu_persnality_sigframe_fdpic() when restoring the
PC from the signal frame since the PC saved by the kernel has the LSB
bit set to zero.

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	libgcc/
	* config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only
	architecture.


Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>

From-SVN: r275575
2019-09-10 09:58:44 +02:00
Christophe Lyon ae1152e5a0 [ARM/FDPIC v6 11/24] [ARM] FDPIC: Add support to unwind FDPIC signal frame
2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	libgcc/
	* unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN)
	(THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC)
	(FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER)
	(FDPIC_FUNCDESC_OFFSET, ARM_NEW_RT_SIGFRAME_UCONTEXT)
	(ARM_UCONTEXT_SIGCONTEXT, ARM_SIGCONTEXT_R0, FDPIC_T2_LDR_R12_WITH_FUNCDESC)
	(FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New.
	(__gnu_personality_sigframe_fdpic): New.
	(get_eit_entry): Add FDPIC signal frame support.


Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>

From-SVN: r275573
2019-09-10 09:55:20 +02:00
Christophe Lyon 5d727a4b20 [ARM/FDPIC v6 06/24] [ARM] FDPIC: Add support for c++ exceptions
The main difference with existing support is that function addresses
are function descriptor addresses instead. This means that all code
dealing with function pointers now has to cope with function
descriptors instead.

For the same reason, Linux kernel helpers can no longer be called by
dereferencing their address, so we implement wrappers that directly
call the kernel helpers.

When restoring a function address, we also have to restore the FDPIC
register value (r9).

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	gcc/
	* ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5
	field.

	libgcc/
	* config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support.
	(__kernel_dmb): Likewise.
	(__fdpic_cmpxchg): New function.
	(__fdpic_dmb): New function.
	* config/arm/unwind-arm.h (FDPIC_REGNUM): New define.
	(gnu_Unwind_Find_got): New function.
	(_Unwind_decode_typeinfo_ptr): Add FDPIC support.
	* unwind-arm-common.inc (UCB_PR_GOT): New.
	(funcdesc_t): New struct.
	(get_eit_entry): Add FDPIC support.
	(unwind_phase2): Likewise.
	(unwind_phase2_forced): Likewise.
	(__gnu_Unwind_RaiseException): Likewise.
	(__gnu_Unwind_Resume): Likewise.
	(__gnu_Unwind_Backtrace): Likewise.
	* unwind-pe.h (read_encoded_value_with_base): Likewise.

	libstdc++/
	* libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC
	support.


Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>

From-SVN: r275568
2019-09-10 09:47:49 +02:00
Christophe Lyon 11189793b6 [ARM/FDPIC v6 05/24] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation
In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy
are referenced by their address, not by pointers to the function
descriptors.

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	libgcc/
	* libgcc/crtstuff.c: Add support for FDPIC.


Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>

From-SVN: r275567
2019-09-10 09:43:37 +02:00
Christophe Lyon b1e21e5a5d [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts
The new arm-uclinuxfdpiceabi target behaves pretty much like
arm-linux-gnueabi. In order to enable the same set of features, we
have to update several configure scripts that generally match targets
like *-*-linux*: in most places, we add *-uclinux* where there is
already *-linux*, or uclinux* when there is already linux*.

In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi
because there is already a different behaviour for *-*uclinux* target.

In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared
libraries support is required, as uclinux does not guarantee that.

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>

	config/
	* futex.m4: Handle *-uclinux*.
	* tls.m4 (GCC_CHECK_TLS): Likewise.

	gcc/
	* config.gcc: Handle *-*-uclinuxfdpiceabi.

	libatomic/
	* configure.tgt: Handle arm*-*-uclinux*.
	* configure: Regenerate.

	libgcc/
	* config.host: Handle *-*-uclinuxfdpiceabi.

	libitm/
	* configure.tgt: Handle *-*-uclinux*.
	* configure: Regenerate.

	* libtool.m4: Handle uclinuxfdpiceabi.

From-SVN: r275564
2019-09-10 09:37:00 +02:00
Jose E. Marchesi 91dfef9610 GCC port for eBPF
This patch series introduces a port of GCC to eBPF, which is a virtual
machine that resides in the Linux kernel.  Initially intended for
user-level packet capture and filtering, eBPF is nowadays generalized
to serve as a general-purpose infrastructure also for non-networking
purposes.

The binutils support is already upstream.  See
https://sourceware.org/ml/binutils/2019-05/msg00306.html.

ChangeLog:

	* MAINTAINERS: Add myself as the maintainer of the eBPF port.
	Remove myself from Write After Approval section.
	* configure.ac: Support for bpf-*-* targets.
	* configure: Regenerate.

contrib/ChangeLog:

	* config-list.mk (LIST): Disable go in bpf-*-* targets.

gcc/ChangeLog:

	* doc/invoke.texi (Option Summary): Cover eBPF.
	(eBPF Options): New section.
	* doc/extend.texi (BPF Built-in Functions): Likewise.
	(BPF Kernel Helpers): Likewise.
	* config.gcc: Support for bpf-*-* targets.
	* common/config/bpf/bpf-common.c: New file.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/predicates.md: Likewise.
	* config/bpf/constraints.md: Likewise.
	* config/bpf/bpf.opt: Likewise.
	* config/bpf/bpf.md: Likewise.
	* config/bpf/bpf.h: Likewise.
	* config/bpf/bpf.c: Likewise.
	* config/bpf/bpf-protos.h: Likewise.
	* config/bpf/bpf-opts.h: Likewise.
	* config/bpf/bpf-helpers.h: Likewise.
	* config/bpf/bpf-helpers.def: Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/builtins-config.h: eBPF doesn't support C99 standard
	functions.
	* gcc.c-torture/compile/20101217-1.c: Add a function prototype for
	printf.
	* gcc.c-torture/compile/20000211-1.c: Skip if target bpf-*-*.
	* gcc.c-torture/compile/poor.c: Likewise.
	* gcc.c-torture/compile/pr25311.c: Likewise.
	* gcc.c-torture/compile/pr39928-1.c: Likewise.
	* gcc.c-torture/compile/pr70061.c: Likewise.
	* gcc.c-torture/compile/920501-7.c: Likewise.
	* gcc.c-torture/compile/20000403-1.c: Likewise.
	* gcc.c-torture/compile/20001226-1.c: Likewise.
	* gcc.c-torture/compile/20030903-1.c: Likewise.
	* gcc.c-torture/compile/20031125-1.c: Likewise.
	* gcc.c-torture/compile/20040101-1.c: Likewise.
	* gcc.c-torture/compile/20040317-2.c: Likewise.
	* gcc.c-torture/compile/20040726-1.c: Likewise.
	* gcc.c-torture/compile/20051216-1.c: Likewise.
	* gcc.c-torture/compile/900313-1.c: Likewise.
	* gcc.c-torture/compile/920625-1.c: Likewise.
	* gcc.c-torture/compile/930421-1.c: Likewise.
	* gcc.c-torture/compile/930623-1.c: Likewise.
	* gcc.c-torture/compile/961004-1.c: Likewise.
	* gcc.c-torture/compile/980504-1.c: Likewise.
	* gcc.c-torture/compile/980816-1.c: Likewise.
	* gcc.c-torture/compile/990625-1.c: Likewise.
	* gcc.c-torture/compile/DFcmp.c: Likewise.
	* gcc.c-torture/compile/HIcmp.c: Likewise.
	* gcc.c-torture/compile/HIset.c: Likewise.
	* gcc.c-torture/compile/QIcmp.c: Likewise.
	* gcc.c-torture/compile/QIset.c: Likewise.
	* gcc.c-torture/compile/SFset.c: Likewise.
	* gcc.c-torture/compile/SIcmp.c: Likewise.
	* gcc.c-torture/compile/SIset.c: Likewise.
	* gcc.c-torture/compile/UHIcmp.c: Likewise.
	* gcc.c-torture/compile/UQIcmp.c: Likewise.
	* gcc.c-torture/compile/USIcmp.c: Likewise.
	* gcc.c-torture/compile/consec.c: Likewise.
	* gcc.c-torture/compile/limits-fndefn.c: Likewise.
	* gcc.c-torture/compile/lll.c: Likewise.
	* gcc.c-torture/compile/parms.c: Likewise.
	* gcc.c-torture/compile/pass.c: Likewise.
	* gcc.c-torture/compile/pp.c: Likewise.
	* gcc.c-torture/compile/pr32399.c: Likewise.
	* gcc.c-torture/compile/pr34091.c: Likewise.
	* gcc.c-torture/compile/pr34688.c: Likewise.
	* gcc.c-torture/compile/pr37258.c: Likewise.
	* gcc.c-torture/compile/pr37327.c: Likewise.
	* gcc.c-torture/compile/pr37381.c: Likewise.
	* gcc.c-torture/compile/pr37669-2.c: Likewise.
	* gcc.c-torture/compile/pr37669.c: Likewise.
	* gcc.c-torture/compile/pr37742-3.c: Likewise.
	* gcc.c-torture/compile/pr44063.c: Likewise.
	* gcc.c-torture/compile/pr48596.c: Likewise.
	* gcc.c-torture/compile/pr51856.c: Likewise.
	* gcc.c-torture/compile/pr54428.c: Likewise.
	* gcc.c-torture/compile/pr54713-1.c: Likewise.
	* gcc.c-torture/compile/pr54713-2.c: Likewise.
	* gcc.c-torture/compile/pr54713-3.c: Likewise.
	* gcc.c-torture/compile/pr55921.c: Likewise.
	* gcc.c-torture/compile/pr70240.c: Likewise.
	* gcc.c-torture/compile/pr70355.c: Likewise.
	* gcc.c-torture/compile/pr82052.c: Likewise.
	* gcc.c-torture/compile/pr83487.c: Likewise.
	* gcc.c-torture/compile/pr86122.c: Likewise.
	* gcc.c-torture/compile/pret-arg.c: Likewise.
	* gcc.c-torture/compile/regs-arg-size.c: Likewise.
	* gcc.c-torture/compile/structret.c: Likewise.
	* gcc.c-torture/compile/uuarg.c: Likewise.
	* gcc.dg/20001009-1.c: Likewise.
	* gcc.dg/20020418-1.c: Likewise.
	* gcc.dg/20020426-2.c: Likewise.
	* gcc.dg/20020430-1.c: Likewise.
	* gcc.dg/20040306-1.c: Likewise.
	* gcc.dg/20040622-2.c: Likewise.
	* gcc.dg/20050603-2.c: Likewise.
	* gcc.dg/20050629-1.c: Likewise.
	* gcc.dg/20061026.c: Likewise.
	* gcc.dg/Warray-bounds-3.c: Likewise.
	* gcc.dg/Warray-bounds-30.c: Likewise.
	* gcc.dg/Wframe-larger-than-2.c: Likewise.
	* gcc.dg/Wframe-larger-than.c: Likewise.
	* gcc.dg/Wrestrict-11.c: Likewise.
	* gcc.c-torture/compile/20000804-1.c: Likewise.
	* lib/target-supports.exp (check_effective_target_trampolines):
	Adapt to eBPF.
	(check_effective_target_indirect_jumps): Likewise.
	(check_effective_target_nonlocal_goto): Likewise.
	(check_effective_target_global_constructor): Likewise.
	(check_effective_target_return_address): Likewise.
	* gcc.target/bpf/bpf.exp: New file.
	* gcc.target/bpf/builtin-load.c: Likewise.
	* cc.target/bpf/constant-calls.c: Likewise.
	* gcc.target/bpf/diag-funargs.c: Likewise.
	* gcc.target/bpf/diag-funargs-2.c: Likewise.
	* gcc.target/bpf/diag-funargs-3.c: Likewise.
	* gcc.target/bpf/diag-indcalls.c: Likewise.
	* gcc.target/bpf/helper-bind.c: Likewise.
	* gcc.target/bpf/helper-bpf-redirect.c: Likewise.
	* gcc.target/bpf/helper-clone-redirect.c: Likewise.
	* gcc.target/bpf/helper-csum-diff.c: Likewise.
	* gcc.target/bpf/helper-csum-update.c: Likewise.
	* gcc.target/bpf/helper-current-task-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-fib-lookup.c: Likewise.
	* gcc.target/bpf/helper-get-cgroup-classid.c: Likewise.
	* gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-get-current-comm.c: Likewise.
	* gcc.target/bpf/helper-get-current-pid-tgid.c: Likewise.
	* gcc.target/bpf/helper-get-current-task.c: Likewise.
	* gcc.target/bpf/helper-get-current-uid-gid.c: Likewise.
	* gcc.target/bpf/helper-get-hash-recalc.c: Likewise.
	* gcc.target/bpf/helper-get-listener-sock.c: Likewise.
	* gcc.target/bpf/helper-get-local-storage.c: Likewise.
	* gcc.target/bpf/helper-get-numa-node-id.c: Likewise.
	* gcc.target/bpf/helper-get-prandom-u32.c: Likewise.
	* gcc.target/bpf/helper-get-route-realm.c: Likewise.
	* gcc.target/bpf/helper-get-smp-processor-id.c: Likewise.
	* gcc.target/bpf/helper-get-socket-cookie.c: Likewise.
	* gcc.target/bpf/helper-get-socket-uid.c: Likewise.
	* gcc.target/bpf/helper-getsockopt.c: Likewise.
	* gcc.target/bpf/helper-get-stack.c: Likewise.
	* gcc.target/bpf/helper-get-stackid.c: Likewise.
	* gcc.target/bpf/helper-ktime-get-ns.c: Likewise.
	* gcc.target/bpf/helper-l3-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-l4-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-lwt-push-encap.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-action.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-map-delete-elem.c: Likewise.
	* gcc.target/bpf/helper-map-lookup-elem.c: Likewise.
	* gcc.target/bpf/helper-map-peek-elem.c: Likewise.
	* gcc.target/bpf/helper-map-pop-elem.c: Likewise.
	* gcc.target/bpf/helper-map-push-elem.c: Likewise.
	* gcc.target/bpf/helper-map-update-elem.c: Likewise.
	* gcc.target/bpf/helper-msg-apply-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-cork-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-pop-data.c: Likewise.
	* gcc.target/bpf/helper-msg-pull-data.c: Likewise.
	* gcc.target/bpf/helper-msg-push-data.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-override-return.c: Likewise.
	* gcc.target/bpf/helper-perf-event-output.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read-value.c: Likewise.
	* gcc.target/bpf/helper-perf-prog-read-value.c: Likewise.
	* gcc.target/bpf/helper-probe-read.c: Likewise.
	* gcc.target/bpf/helper-probe-read-str.c: Likewise.
	* gcc.target/bpf/helper-probe-write-user.c: Likewise.
	* gcc.target/bpf/helper-rc-keydown.c: Likewise.
	* gcc.target/bpf/helper-rc-pointer-rel.c: Likewise.
	* gcc.target/bpf/helper-rc-repeat.c: Likewise.
	* gcc.target/bpf/helper-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-set-hash.c: Likewise.
	* gcc.target/bpf/helper-set-hash-invalid.c: Likewise.
	* gcc.target/bpf/helper-setsockopt.c: Likewise.
	* gcc.target/bpf/helper-skb-adjust-room.c: Likewise.
	* gcc.target/bpf/helper-skb-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-skb-change-head.c: Likewise.
	* gcc.target/bpf/helper-skb-change-proto.c: Likewise.
	* gcc.target/bpf/helper-skb-change-tail.c: Likewise.
	* gcc.target/bpf/helper-skb-change-type.c: Likewise.
	* gcc.target/bpf/helper-skb-ecn-set-ce.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-get-xfrm-state.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes-relative.c: Likewise.
	* gcc.target/bpf/helper-skb-pull-data.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-pop.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-push.c: Likewise.
	* gcc.target/bpf/helper-skc-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-fullsock.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-upd.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-sk-release.c: Likewise.
	* gcc.target/bpf/helper-sk-select-reuseport.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-delete.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-get.c: Likewise.
	* gcc.target/bpf/helper-sock-hash-update.c: Likewise.
	* gcc.target/bpf/helper-sock-map-update.c: Likewise.
	* gcc.target/bpf/helper-sock-ops-cb-flags-set.c: Likewise.
	* gcc.target/bpf/helper-spin-lock.c: Likewise.
	* gcc.target/bpf/helper-spin-unlock.c: Likewise.
	* gcc.target/bpf/helper-strtol.c: Likewise.
	* gcc.target/bpf/helper-strtoul.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-name.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise.
	* gcc.target/bpf/helper-tail-call.c: Likewise.
	* gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise.
	* gcc.target/bpf/helper-tcp-sock.c: Likewise.
	* gcc.target/bpf/helper-trace-printk.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-head.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-tail.c: Likewise.
	* gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise.
	* gcc.target/bpf/sync-fetch-and-add.c: Likewise.

libgcc/ChangeLog:

	* config.host: Set cpu_type for bpf-*-* targets.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/crtn.S: Likewise.
	* config/bpf/crti.S: New file.

From-SVN: r275506
2019-09-09 12:13:23 +02:00
Jim Wilson 2f4d895197 RISC-V: Re-enable -msave-restore for shared libraries.
This re-enables -msave-restore for shared libraries, and uses the
t-slibgcc-libgcc file to get the save-restore routines included directly
in shared libraries so that we don't need to indirect through the PLT
to reach them, which doesn't work.

	gcc/
	* config/riscv/riscv.c (riscv_option_override): Revert 2019-08-30
	change.

	libgcc/
	* config.host (riscv*-*-linux*): Add t-slibgcc-libgcc to tmake_file.
	(riscv*-*-freebsd*): Likewise.

From-SVN: r275478
2019-09-06 17:09:21 -07:00
Ulrich Weigand 2f2aeda98f Remove Cell Broadband Engine SPU targets
From-SVN: r275343
2019-09-03 15:08:28 +00:00
Jozef Lawrynowicz d16017da34 re PR target/91306 ([MSP430] libgcc/crtstuff.c: Alignment of frame_dummy .init_array entry is too big)
2019-08-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	PR target/91306
	* crtstuff.c (__CTOR_LIST__): Align to the "__alignof__" the array
	element type, instead of "sizeof" the element type.
	(__DTOR_LIST__): Likewise.
	(__TMC_LIST__): Likewise.
	(__do_global_dtors_aux_fini_array_entry): Likewise.
	(__frame_dummy_init_array_entry): Likewise.
	(__CTOR_END__): Likewise.
	(__DTOR_END__): Likweise.
	(__FRAME_END__): Likewise.
	(__TMC_END__): Likewise.

From-SVN: r274846
2019-08-23 09:21:26 +00:00
Hongtao Liu a9fcfec30f Add TIGERLAKE and COOPERLAKE to GCC.
2019-08-20  Lili Cui  <lili.cui@intel.com>

gcc/
	* common/config/i386/i386-common.c
	(processor_names): Add tigerlake and cooperlake.
	(processor_alias_table): Add tigerlake and cooperlake.
	* config.gcc: Add -march=tigerlake and cooperlake.
	* config/i386/driver-i386.c
	(host_detect_local_cpu): Detect tigerlake and cooperlake.
	Add "has_avx" to classify processor.
	* config/i386/i386-builtins.c (processor_model):
	Add M_INTEL_COREI7_TIGERLAKE and M_INTEL_COREI7_COOPERLAKE.
	(arch_names_table): Add tigerlake and cooperlake.
	(get_builtin_code_for_version) : Handle PROCESSOR_TIGERLAKE and
	PROCESSOR_COOPERLAKE.
	* config/i386/i386-c.c
	(ix86_target_macros_internal): Handle tigerlake and cooperlake.
	* config/i386/i386-options.c
	(m_TIGERLAKE)  : Define.
	(m_COOPERLAKE) : Ditto.
	(m_CORE_AVX512): Ditto.
	(processor_cost_table): Add cascadelake.
	(ix86_option_override_internal): Hadle PTA_MOVDIRI, PTA_MOVDIR64B.
	* config/i386/i386.h
	(ix86_size_cost) : Define TARGET_TIGERLAKE and TARGET_COOPERLAKE.
	(processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE.
	(PTA_MOVDIRI): Ditto.
	(PTA_MOVDIR64B): Ditto.
	(PTA_COOPERLAKE) : Ditto.
	(PTA_TIGERLAKE)  : Ditto.
	(processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE.
	* doc/extend.texi: Add tigerlake and cooperlake.
	* doc/invoke.texi: Add tigerlake and cooperlake.

gcc/testsuite/
	* gcc.target/i386/funcspec-56.inc: Handle new march.
	* g++.target/i386/mv16.C: Handle new march

libgcc/
	* config/i386/cpuinfo.h: Add INTEL_COREI7_TIGERLAKE and
	INTEL_COREI7_COOPERLAKE.

From-SVN: r274693
2019-08-20 07:06:03 +00:00
Matt Thomas 428642b132 config.gcc (hppa*-*-netbsd*): New target.
gcc/ChangeLog:
	* config.gcc (hppa*-*-netbsd*): New target.
	* config/pa/pa-netbsd.h: New file.
	* config/pa/pa32-netbsd.h: New file.

libgcc/ChangeLog:
	* config.host (hppa*-*-netbsd*): New case.
	* config/pa/t-netbsd: New file.


Co-Authored-By: Matthew Green <mrg@eterna.com.au>
Co-Authored-By: Maya Rashish <coypu@sdf.org>
Co-Authored-By: Nick Hudson <nick@nthcliff.demon.co.uk>

From-SVN: r273933
2019-07-31 14:11:16 +00:00
Joel Hutton f0efd92502 [Arm][CMSE]Add warn_unused_return attribute to cmse functions
At present it is possible to call the CMSE functions for checking
addresses (such as cmse_check_address_range) and  forget to check/use
the return value. This patch makes the interfaces more robust against
programmer error by marking these functions with the warn_unused_result
attribute. With this set, any use of these functions that does not use
the result will produce a warning.

This produces a warning on default warn levels when the result of the
cmse functions is not used.

For the following function:
void foo()
{
     int *data;
     cmse_check_address_range((int*)data, 0, 0);
}
The following warning is emitted:
warning: ignoring return value of 'cmse_check_address_range' declared
with attribute 'warn_unused_result' [-Wunused-result]
     6 |  cmse_check_address_range((int*)data, 0, 0);
        |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc/ChangeLog:

2019-07-31  Joel Hutton  <Joel.Hutton@arm.com>

         * config/arm/arm_cmse.h (cmse_nonsecure_caller): Add
warn_unused_result attribute.
         (cmse_check_address_range): Add warn_unused_result attribute.

libgcc/ChangeLog:

2019-07-31  Joel Hutton  <Joel.Hutton@arm.com>

         * config/arm/cmse.c (cmse_check_address_range): Add
warn_unused_result attribute.

2019-07-31  Joel Hutton  <Joel.Hutton@arm.com>

         * gcc.target/arm/cmse/cmse-17.c: New test.

From-SVN: r273924
2019-07-31 08:56:35 +00:00
Martin Liska a861990d21 Do not emit __gnu_lto_v1 symbol.
2019-07-22  Martin Liska  <mliska@suse.cz>

	* config/avr/avr.c (avr_asm_output_aligned_decl_common): Update
	comment.
	* toplev.c (compile_file): Do not emit __gnu_lto_v1 symbol.
2019-07-22  Martin Liska  <mliska@suse.cz>

	* config/pa/stublib.c: Remove stub symbol __gnu_lto_v1.
	* config/pa/t-stublib: Likewise.
2019-07-22  Martin Liska  <mliska@suse.cz>

	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
	Do not search for gnu_lto_v1, but search for first '\0'.

From-SVN: r273662
2019-07-22 07:34:47 +00:00
Stafford Horne 9c0dba7c45 or1k: Fix issues with msoft-div
Fixes bad assembly logic with software divide as reported by Richard Selvaggi.
Also, add a basic test to verify the soft math works when enabled.

gcc/testsuite/ChangeLog:

	PR target/90362
	* gcc.target/or1k/div-mul-3.c: New test.

libgcc/ChangeLog:

	PR target/90362
	* config/or1k/lib1funcs.S (__udivsi3): Change l.sfeqi
	to l.sfeq and l.sfltsi to l.sflts equivalents as the immediate
	instructions are not available on every processor.  Change a
	l.bnf to l.bf to fix logic issue.

From-SVN: r273648
2019-07-21 20:59:50 +00:00
Iain Sandoe 61afc8f8f0 [Darwin] Revert one hunk from r273016 (TLC for older Darwin versions).
t-darwin8 is nolonger needed (or present) for pre-10.4 powerpc, so remove
the reference.

2019-07-04  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Remove reference to t-darwin8.

From-SVN: r273091
2019-07-04 18:28:59 +00:00
Iain Sandoe 179c7ef523 [Darwin] Some TLC for older Darwin versions.
The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat.  This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it's documented why the specs are as
they are.

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

	* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
	(STARTFILE_SPEC): Split crt3 into a separate spec.
	(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
	(DARWIN_CRT2_SPEC): New.
	(DARWIN_CRT3_SPEC): New.
	(MIN_LD64_OMIT_STUBS): Revise to 62.1.
	* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
	(DARWIN_CRT3_SPEC): New.

libgcc/

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
	list.
	* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
	mmacosx-version-min for crts to run across all system versions.
	* config/rs6000/t-darwin64 (LIB2ADD): Remove.
	* config/t-darwin: Revise mmacosx-version-min for crts to run across
	system versions >= 10.4.

From-SVN: r273016
2019-07-03 18:36:28 +00:00
Martin Liska 596341c741 Rename SINGE_VALUE to TOPN_VALUES counters.
2019-07-03  Martin Liska  <mliska@suse.cz>

	* gcov-counter.def (GCOV_COUNTER_V_SINGLE): Remove.
	(GCOV_COUNTER_V_TOPN): New.
	(GCOV_COUNTER_V_INDIR): Use _topn.
	* gcov-io.h (GCOV_DISK_SINGLE_VALUES): Remove.
	(GCOV_TOPN_VALUES): New.
	(GCOV_SINGLE_VALUE_COUNTERS): Remove.
	(GCOV_TOPN_VALUES_COUNTERS): New.
	* profile.c (instrument_values): Use HIST_TYPE_TOPN_VALUES.
	* tree-profile.c:
	(gimple_init_gcov_profiler): Rename variables from one_value
	to topn_values.
	(gimple_gen_one_value_profiler): Remove.
	(gimple_gen_topn_values_profiler): New function.
	* value-prof.c (dump_histogram_value): Use TOPN_VALUES
	names instead of SINGLE_VALUE.
	(stream_out_histogram_value): Likewise.
	(stream_in_histogram_value): Likewise.
	(get_most_common_single_value): Likewise.
	(gimple_divmod_fixed_value_transform): Likewise.
	(gimple_stringops_transform): Likewise.
	(gimple_divmod_values_to_profile): Likewise.
	(gimple_stringops_values_to_profile): Likewise.
	(gimple_find_values_to_profile): Likewise.
	* value-prof.h (enum hist_type): Rename to TOPN.
	(gimple_gen_one_value_profiler): Remove.
	(gimple_gen_topn_values_profiler): New.
2019-07-03  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Use topn_values instead of one_value names.
	* libgcov-merge.c (__gcov_merge_single): Move to ...
	(__gcov_merge_topn): ... this.
	(merge_single_value_set): Move to ...
	(merge_topn_values_set): ... this.
	* libgcov-profiler.c (__gcov_one_value_profiler_body): Move to
	...
	(__gcov_topn_values_profiler_body): ... this.
	(__gcov_one_value_profiler_v2): Move to ...
	(__gcov_topn_values_profiler): ... this.
	(__gcov_one_value_profiler_v2_atomic): Move to ...
	(__gcov_topn_values_profiler_atomic): ... this.
	(__gcov_indirect_call_profiler_v4): Remove.
	* libgcov-util.c (__gcov_single_counter_op): Move to ...
	(__gcov_topn_counter_op): ... this.
	* libgcov.h (L_gcov_merge_single): Remove.
	(L_gcov_merge_topn): New.
	(__gcov_merge_single): Remove.
	(__gcov_merge_topn): New.
	(__gcov_one_value_profiler_v2): Move to ..
	(__gcov_topn_values_profiler): ... this.
	(__gcov_one_value_profiler_v2_atomic): Move to ...
	(__gcov_topn_values_profiler_atomic): ... this.

From-SVN: r273005
2019-07-03 12:42:23 +00:00
Martin Liska 1b309ca5ed Support N values in libgcov for single value counter type.
2019-07-03  Martin Liska  <mliska@suse.cz>

	* gcc.dg/tree-prof/val-prof-2.c: Update scanned pattern
	as we do now better.
2019-07-03  Martin Liska  <mliska@suse.cz>

	* libgcov-merge.c (merge_single_value_set): Support N values.
	* libgcov-profiler.c (__gcov_one_value_profiler_body): Likewise.

From-SVN: r273004
2019-07-03 12:42:02 +00:00
Ilia Diachkov 5a4602805e Add --disable-tm-clone-registry libgcc configure option.
This patch adds libgcc configuration option to disable TM clone 
registry. This option helps to reduce code size for embedded targets 
which do not need transactional memory support.

	gcc/
	* doc/install.texi: Document --disable-tm-clone-registry.
	libgcc/
	* Makefile.in (USE_TM_CLONE_REGISTRY): New.
	(CRTSTUFF_CFLAGS): Use USE_TM_CLONE_REGISTRY.
	* configure.ac: Add --disable-tm-clone-registry option.
	* configure: Regenerate.

From-SVN: r272769
2019-06-27 16:41:03 -07:00
Martin Liska 45309d286c Remove quite obvious dead assignments.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* asan.c (asan_emit_allocas_unpoison): Remove obviously
	dead assignments.
	* bt-load.c (move_btr_def): Likewise.
	* builtins.c (expand_builtin_apply_args_1): Likewise.
	(expand_builtin_apply): Likewise.
	* cfgexpand.c (expand_asm_stmt): Likewise.
	(construct_init_block): Likewise.
	* cfghooks.c (verify_flow_info): Likewise.
	* cfgloopmanip.c (remove_path): Likewise.
	* cfgrtl.c (rtl_verify_bb_layout): Likewise.
	* cgraph.c (cgraph_node::set_pure_flag): Likewise.
	* combine.c (simplify_if_then_else): Likewise.
	* config/i386/i386.c (ix86_setup_incoming_vararg_bounds): Likewise.
	(choose_basereg): Likewise.
	(ix86_expand_prologue): Likewise.
	(ix86_preferred_output_reload_class): Likewise.
	* cselib.c (cselib_record_sets): Likewise.
	* df-scan.c (df_scan_alloc): Likewise.
	* dojump.c (do_jump_by_parts_greater_rtx): Likewise.
	* early-remat.c (early_remat::record_equiv_candidates): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* graphite-scop-detection.c (assign_parameter_index_in_region): Likewise.
	* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Likewise.
	* ira-color.c (setup_profitable_hard_regs): Likewise.
	* ira.c (rtx_moveable_p): Likewise.
	* lra-eliminations.c (eliminate_regs_in_insn): Likewise.
	* read-rtl.c (read_subst_mapping): Likewise.
	* regrename.c (scan_rtx): Likewise.
	* reorg.c (fill_slots_from_thread): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	* tree-ssa-reassoc.c (optimize_ops_list): Likewise.
	* tree-ssa-sink.c (statement_sink_location): Likewise.
	* tree-ssa-threadedge.c (thread_across_edge): Likewise.
	* tree-vect-loop.c (vect_get_loop_niters): Likewise.
	(vect_create_epilog_for_reduction): Likewise.
	* tree.c (build_nonstandard_integer_type): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* class.c (adjust_clone_args): Remove obviously
	dead assignments.
	(dump_class_hierarchy_r): Likewise.
	* decl.c (check_initializer): Likewise.
	* parser.c (cp_parser_lambda_expression): Likewise.
	* pt.c (unify_bound_ttp_args): Likewise.
	(convert_template_argument): Likewise.
	* rtti.c (build_headof): Likewise.
	* typeck.c (convert_for_initialization): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* libgcov-driver-system.c (gcov_exit_open_gcda_file): Remove obviously
	dead assignments.
	* libgcov-util.c: Likewise.

From-SVN: r272744
2019-06-27 10:25:21 +00:00
Martin Liska c2f7a665a1 Fix misc stuff seen by clang-static-analyzer.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* lto-dump.c (struct symbol_entry): Add default dtor.
	(struct variable_entry): Likewise.
	(struct function_entry): Likewise.
	(dump_list_functions): Release memory.
	(dump_list_variables): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* libgcov-util.c (gcov_profile_merge): Release allocated
	memory.
	(calculate_overlap): Likewise.

From-SVN: r272733
2019-06-27 08:21:32 +00:00
Iain Sandoe a8e55c61f8 [Darwin, PPC] Move the out of line register save/restore to an endfile.
We have been including this in libgcc, which means that we have to append
-lgcc even when using shared libgcc. In preparation for revision of libgcc
split this into an endfile.

gcc/
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): New.

libgcc/
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
	* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
	Build objects for the out of line save/restore register functions
	so that they can be used for any supported Darwin version.
	* config/t-darwin: Default the build Darwin version to Darwin8
	(MacOS 10.4).

From-SVN: r272659
2019-06-25 20:11:11 +00:00
Martin Liska e5ce4cbc72 Do not call strlen with NULL argument in libgcov.
2019-06-25  Martin Liska  <mliska@suse.cz>

	* libgcov-driver-system.c (replace_filename_variables): Do not
	call strlen with NULL argument.

From-SVN: r272650
2019-06-25 11:49:36 +00:00
Andrew Stubbs 52a47d2856 Stub implementation of unwinding for AMD GCN.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	libgcc/
	* config/gcn/t-amdgcn (LIB2ADD): Add unwind-gcn.c.
	* config/gcn/unwind-gcn.c: New file.

From-SVN: r272648
2019-06-25 11:41:33 +00:00
Kwok Cheung Yeung 76d4633107 Create GCN-specific gthreads
2019-06-25  Kwok Cheung Yeung  <kcy@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>

        gcc/
	* config.gcc (thread_file): Set to gcn for AMD GCN.
	* config/gcn/gcn.c (gcn_emutls_var_init): New function.
	(TARGET_EMUTLS_VAR_INIT): New hook.

	config/
	* gthr.m4 (GCC_AC_THREAD_HEADER): Add case for gcn.

	libgcc/
	* configure: Regenerate.
	* config/gcn/gthr-gcn.h: New.

Co-Authored-By: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r272647
2019-06-25 11:41:29 +00:00
Tom de Vries 787783a035 [nvptx] Fix __main missing prototype warning in crt0.c
Atm we see:
...
libgcc/config/nvptx/crt0.c:36:1: warning: no previous prototype for \
  ‘__main’ [-Wmissing-prototypes]
...

Fix this by adding the prototype.

Build and reg-tested on nvptx.
Build and reg-tested on x86_64 with nvptx accelerator.

2019-06-18  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/crt0.c (__main): Declare.

From-SVN: r272412
2019-06-18 09:19:28 +00:00
Matthew Green f32f75858a [netbsd][aarch64] add netbsd/aarch64 target
Initial support for AArch64 running NetBSD.

Matthew Green <mrg@eterna.com.au>
Maya Rashish <coypu@sdf.org>

gcc:
	* config.gcc (aarch64*-*-netbsd*): New target.
	* config/aarch64/aarch64-netbsd.h: New file.
	* config/aarch64/t-aarch64-netbsd: Likewise.

libgcc:
	* config.host (aarch64*-*-netbsd*): New case.

Co-Authored-By: Maya Rashish <coypu@sdf.org>

From-SVN: r272387
2019-06-17 14:43:11 +00:00
Jozef Lawrynowicz 0fcc78f79e MSP430: Implement 64-bit shifts in assembly code
gcc/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.c (msp430_expand_helper): Setup arguments which
	describe how to perform MSPABI compliant 64-bit shift.
	* config/msp430/msp430.md (ashldi3): New define_expand.
	(ashrdi3): New define_expand.
	(lshrdi3): New define_expand.

libgcc/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/slli.S (__mspabi_sllll): New library function for
	performing a logical left shift of a 64-bit value.
	* config/msp430/srai.S (__mspabi_srall): New library function for
	performing a arithmetic right shift of a 64-bit value.
	* config/msp430/srll.S (__mspabi_srlll): New library function for
	performing a logical right shift of a 64-bit value.

gcc/testsuite/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* gcc.target/msp430/mspabi_sllll.c: New test.
	* gcc.target/msp430/mspabi_srall.c: New test.
	* gcc.target/msp430/mspabi_srlll.c: New test.
	* gcc.c-torture/execute/shiftdi-2.c: New test.

From-SVN: r272360
2019-06-16 21:24:56 +00:00
Matt Thomas b27c108234 [NetBSD] Add support for the Arm EABI.
This is a roll-up of a set of changes needed to support the Arm EABI on NetBSD.

2019-06-14  Matt Thomas  <matt@3am-software.com>
	    Matthew Green  <mrg@eterna.com.au>
	    Nick Hudson  <skrll@netbsd.org>
	    Maya Rashish  <coypu@sdf.org>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	* config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration.
	* config.host (arm*-*-netbsd*): Use driver-arm.o on native NetBSD.
	* config/arm/netbsd-eabi.h: New file.
	* config/arm/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Undefine before
	redefining.
	(SUBTARGET_EXTRA_ASM_SPEC): Don't pass -matpcs to the assembler.
	* config/netbsd-elf.h (NETBSD_LINK_LD_ELF_SO_SPEC): New define.
	(NETBSD_SUBTARGET_EXTRA_SPECS): New define.
	(SUBTARGET_EXTRA_SPECS): Define to NETBSD_SUBTARGET_EXTRA_SPECS.

libatomic:
	* configure.tgt (arm*): Handle NetBSD in the same way as FreeBSD.

libgcc:
	* config.host (arm*-*-netbsdelf*): Add support for EABI configurations.
	* config/arm/t-netbsd (LIB1ASMFUNCS): Add some additional assembler
	functions to build.
	* config/arm/t-netbsd-eabi: New file.


Co-Authored-By: Matthew Green <mrg@eterna.com.au>
Co-Authored-By: Maya Rashish <coypu@sdf.org>
Co-Authored-By: Nick Hudson <skrll@netbsd.org>
Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>

From-SVN: r272290
2019-06-14 14:04:20 +00:00
Dimitar Dimitrov ae7deb4b85 Initial TI PRU libgcc port
libgcc/ChangeLog:

2019-06-12  Dimitar Dimitrov  <dimitar@dinux.eu>

	* config.host: Add PRU target.
	* config/pru/asri.c: New file.
	* config/pru/eqd.c: New file.
	* config/pru/eqf.c: New file.
	* config/pru/ged.c: New file.
	* config/pru/gef.c: New file.
	* config/pru/gtd.c: New file.
	* config/pru/gtf.c: New file.
	* config/pru/led.c: New file.
	* config/pru/lef.c: New file.
	* config/pru/lib2bitcountHI.c: New file.
	* config/pru/lib2divHI.c: New file.
	* config/pru/lib2divQI.c: New file.
	* config/pru/lib2divSI.c: New file.
	* config/pru/libgcc-eabi.ver: New file.
	* config/pru/ltd.c: New file.
	* config/pru/ltf.c: New file.
	* config/pru/mpyll.S: New file.
	* config/pru/pru-abi.h: New file.
	* config/pru/pru-asm.h: New file.
	* config/pru/pru-divmod.h: New file.
	* config/pru/sfp-machine.h: New file.
	* config/pru/t-pru: New file.

From-SVN: r272204
2019-06-12 19:28:51 +00:00
Jakub Jelinek 0d7b3e477b * libgcov-merge.c (__gcov_merge_single): Revert previous change.
From-SVN: r272143
2019-06-11 09:54:17 +02:00
Martin Liska 54e2d83caf Add missing ATTR_UNUSED (PR bootstrap/90808).
2019-06-10  Martin Liska  <mliska@suse.cz>

	PR bootstrap/90808
	* libgcov.h: Add ATTRIBUTE_UNUSED.

From-SVN: r272114
2019-06-10 09:53:46 +00:00
Martin Liska 92d417175b Implement N disk counters for single value and indirect call counters.
2019-06-10  Martin Liska  <mliska@suse.cz>

	* gcov-io.h (GCOV_DISK_SINGLE_VALUES): New.
	(GCOV_SINGLE_VALUE_COUNTERS): Likewise.
	* ipa-profile.c (ipa_profile_generate_summary):
	Use get_most_common_single_value.
	* tree-profile.c (gimple_init_gcov_profiler):
	Instrument with __gcov_one_value_profiler_v2
	and __gcov_indirect_call_profiler_v4.
	* value-prof.c (dump_histogram_value):
	Print all values for HIST_TYPE_SINGLE_VALUE.
	(stream_out_histogram_value): Update assert for
	N values.
	(stream_in_histogram_value): Set number of
	counters for HIST_TYPE_SINGLE_VALUE.
	(get_most_common_single_value): New.
	(gimple_divmod_fixed_value_transform):
	Use get_most_common_single_value.
	(gimple_ic_transform): Likewise.
	(gimple_stringops_transform): Likewise.
	(gimple_find_values_to_profile): Set number
	of counters for HIST_TYPE_SINGLE_VALUE.
	* value-prof.h (get_most_common_single_value):
	New.
2019-06-10  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Add __gcov_one_value_profiler_v2,
	__gcov_one_value_profiler_v2_atomic and
	__gcov_indirect_call_profiler_v4.
	* libgcov-merge.c (__gcov_merge_single): Change
	function signature.
	(merge_single_value_set): New.
	* libgcov-profiler.c (__gcov_one_value_profiler_body):
	Update functionality.
	(__gcov_one_value_profiler): Remove.
	(__gcov_one_value_profiler_v2): ... this.
	(__gcov_one_value_profiler_atomic): Rename to ...
	(__gcov_one_value_profiler_v2_atomic): this.
	(__gcov_indirect_call_profiler_v3): Rename to ...
	(__gcov_indirect_call_profiler_v4): ... this.
	* libgcov.h (__gcov_one_value_profiler): Remove.
	(__gcov_one_value_profiler_atomic): Remove.
	(__gcov_one_value_profiler_v2_atomic): New.
	(__gcov_indirect_call_profiler_v3): Remove.
	(__gcov_one_value_profiler_v2): New.
	(__gcov_indirect_call_profiler_v4): New.
	(gcov_get_counter_ignore_scaling): New function.

From-SVN: r272106
2019-06-10 07:38:59 +00:00
Martin Liska e37333bad7 Remove indirect call top N counter type.
2019-06-07  Martin Liska  <mliska@suse.cz>

	* doc/invoke.texi: Remove param.
	* gcov-counter.def (GCOV_COUNTER_ICALL_TOPNV):
	Remove.
	* gcov-io.h (GCOV_ICALL_TOPN_VAL): Likewise.
	(GCOV_ICALL_TOPN_NCOUNTS): Likewise.
	* params.def (PARAM_INDIR_CALL_TOPN_PROFILE): Likewise.
	* profile.c (instrument_values): Remove
	HIST_TYPE_INDIR_CALL_TOPN.
	* tree-profile.c (init_ic_make_global_vars):
	Always build __gcov_indirect_call only.
	(gimple_init_gcov_profiler): Remove usage
	of PARAM_INDIR_CALL_TOPN_PROFILE.
	(gimple_gen_ic_profiler): Likewise.
	* value-prof.c (dump_histogram_value): Likewise.
	(stream_in_histogram_value): Likewise.
	(gimple_indirect_call_to_profile): Likewise.
	(gimple_find_values_to_profile): Likewise.
	* value-prof.h (enum hist_type): Likewise.
2019-06-07  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Remove usage of
	_gcov_merge_icall_topn.
	* libgcov-driver.c (gcov_sort_n_vals): Remove.
	(gcov_sort_icall_topn_counter): Likewise.
	(gcov_sort_topn_counter_arrays): Likewise.
	(dump_one_gcov): Remove call to gcov_sort_topn_counter_arrays.
	* libgcov-merge.c (__gcov_merge_icall_topn): Remove.
	* libgcov-profiler.c (__gcov_topn_value_profiler_body):
	Likewise.
	(GCOV_ICALL_COUNTER_CLEAR_THRESHOLD): Remove.
	(struct indirect_call_tuple): Remove.
	(__gcov_indirect_call_topn_profiler): Remove.
	* libgcov-util.c (__gcov_icall_topn_counter_op): Remove.
	* libgcov.h (gcov_sort_n_vals): Remove.
	(L_gcov_merge_icall_topn): Likewise.
	(__gcov_merge_icall_topn): Likewise.
	(__gcov_indirect_call_topn_profiler): Likewise.

From-SVN: r272030
2019-06-07 06:41:58 +00:00
Iain Sandoe 34a4a9c2b5 Darwin, PowerPC, libgcc - Ensure unwinder is built with altivec enabled.
When libgcc is built on Darwin, it is usually built for the earliest potential
target (Darwin8, 10.4).  Build for that revision default to assuming that the
processor might be G3 (without vector ops) and there is an outlined function
used for save/restore that checks whether the processor is G3 or G4+ at run-
time.  However, the unwinder itself needs to be built with the assumption of
vector usage so that the relevant outlined functions are called.

2019-06-06  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/t-darwin: Ensure that the unwinder is built with
	altivec enabled.

From-SVN: r272017
2019-06-06 19:02:54 +00:00
Jozef Lawrynowicz d1b2f85f78 MSP430: Put libgcc shift functions in their own section
2019-06-06  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/slli.S (__mspabi_slli_n): Put function in its own
	section.
	(__mspabi_slli): Likewise.
	(__mspabi_slll_n): Likewise.
	(__mspabi_slll): Likewise.
	* config/msp430/srai.S (__mspabi_srai_n): Likewise.
	(__mspabi_srai): Likewise.
	(__mspabi_sral_n): Likewise.
	(__mspabi_sral): Likewise.
	* config/msp430/srli.S (__mspabi_srli_n): Likewise.
	(__mspabi_srli): Likewise.
	(__mspabi_srll_n): Likewise.
	(__mspabi_srll): Likewise.

From-SVN: r271992
2019-06-06 09:07:36 +00:00
Yoshinori Sato e69a13d15d config.host (rx-*-linux*): Add t-fdpbit to tmake_file Add appropriate tm_file clause as well.
* config.host (rx-*-linux*): Add t-fdpbit to tmake_file
        Add appropriate tm_file clause as well.
        * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Remove.

From-SVN: r271978
2019-06-05 17:20:27 -06:00
James Clarke b009eac157 crtbegin.S (__dso_handle): Put in .sdata/.sbss rather than .data/.bss so it can be accessed via...
* config/ia64/crtbegin.S (__dso_handle): Put in .sdata/.sbss
	rather than .data/.bss so it can be accessed via gp-relative
	addressing.

From-SVN: r271977
2019-06-05 16:27:37 -06:00
David Edelsohn 781d39f26e aix-unwind.h (LR_REGNO): Rename to R_LR.
* config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR.
(CR2_REGNO): Rename to R_CR2.
(XER_REGNO): Rename to R_XER.
(FIRST_ALTIVEC_REGNO): Rename to R_FIRST_ALTIVEC.
(VRSAVE_REGNO): Rename to R_VRSAVE.
(VSCR_REGNO): R_VSCR.

From-SVN: r271967
2019-06-05 12:45:57 -04:00
Yoshinori Sato 76aaa9cdb1 config.gcc (rx-*-linux*): New target.
* config.gcc (rx-*-linux*): New target.
	* config/rx/elf.opt: New file.
	* config/rx/linux.h: Likewise.
	* config/rx/t-linux: Likewise.
	* config/rx/rx.c (TARGET_SAVE_ACC_REGISTER): If not defined,
	make it zero.
	* config/rx/rx.h (ASM_APP_ON): Allow to be overridden.
	(ASM_APP_OFF): Likewise.
	* config/rx/rx.opt: Drop -msim and -mas100-syntax, they were
	moved elsewhere.

	* config.host (rx-*-linux*): Add new case.
	* config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Force DFmode to SFmode.

From-SVN: r271748
2019-05-29 12:36:06 -06:00
Sam Tebbs 8fc16d7252 [PATCH 3/3][GCC][AARCH64] Add support for pointer authentication B key
gcc/
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* config/aarch64/aarch64-builtins.c (aarch64_builtins): Add
	AARCH64_PAUTH_BUILTIN_AUTIB1716 and AARCH64_PAUTH_BUILTIN_PACIB1716.
	* config/aarch64/aarch64-builtins.c (aarch64_init_pauth_hint_builtins):
	Add autib1716 and pacib1716 initialisation.
	* config/aarch64/aarch64-builtins.c (aarch64_expand_builtin): Add checks
	for autib1716 and pacib1716.
	* config/aarch64/aarch64-protos.h (aarch64_key_type,
	aarch64_post_cfi_startproc): Define.
	* config/aarch64/aarch64-protos.h (aarch64_ra_sign_key): Define extern.
	* config/aarch64/aarch64.c (aarch64_handle_standard_branch_protection,
	aarch64_handle_pac_ret_protection): Set default sign key to A.
	* config/aarch64/aarch64.c (aarch64_expand_epilogue,
	aarch64_expand_prologue): Add check for b-key.
	* config/aarch64/aarch64.c (aarch64_ra_sign_key,
	aarch64_post_cfi_startproc, aarch64_handle_pac_ret_b_key): Define.
	* config/aarch64/aarch64.h (TARGET_ASM_POST_CFI_STARTPROC): Define.
	* config/aarch64/aarch64.c (aarch64_pac_ret_subtypes): Add "b-key".
	* config/aarch64/aarch64.md (unspec): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIA1716,
	UNSPEC_PACIB1716, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/aarch64.md (do_return): Add check for b-key.
	* config/aarch64/aarch64.md (<pauth_mnem_prefix>sp): Replace
	pauth_hint_num_a with pauth_hint_num.
	* config/aarch64/aarch64.md (<pauth_mnem_prefix>1716): Replace
	pauth_hint_num_a with pauth_hint_num.
	* config/aarch64/aarch64.opt (msign-return-address=): Deprecate.
	* config/aarch64/iterators.md (PAUTH_LR_SP): Add UNSPEC_AUTIASP,
	UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/iterators.md (PAUTH_17_16): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716.
	* config/aarch64/iterators.md (pauth_mnem_prefix): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716, UNSPEC_AUTIASP,
	UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/iterators.md (pauth_hint_num_a): Replace
	UNSPEC_PACI1716 and UNSPEC_AUTI1716 with UNSPEC_PACIA1716 and
	UNSPEC_AUTIA1716 respectively.
	* config/aarch64/iterators.md (pauth_hint_num_a): Rename to pauth_hint_num
	and add UNSPEC_PACIBSP, UNSPEC_AUTIBSP, UNSPEC_PACIB1716, UNSPEC_AUTIB1716.
	* doc/invoke.texi (-mbranch-protection): Add b-key type.
	* config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Rename
	UNSPEC_PACISP to UNSPEC_PACIASP and UNSPEC_PACIBSP.

gcc/testsuite
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* gcc.target/aarch64/return_address_sign_b_1.c: New file.
	* gcc.target/aarch64/return_address_sign_b_2.c: New file.
	* gcc.target/aarch64/return_address_sign_b_3.c: New file.
	* gcc.target/aarch64/return_address_sign_b_exception.c: New file.
	* gcc.target/aarch64/return_address_sign_ab_exception.c: New file.
	* gcc.target/aarch64/return_address_sign_builtin.c: New file

libgcc/
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New
	function.
	* config/aarch64/aarch64-unwind.h (aarch64_post_extract_frame_addr,
	aarch64_post_frob_eh_handler_addr): Add	check for b-key.
	* config/aarch64/aarch64-unwind-h (aarch64_post_extract_frame_addr,
	aarch64_post_frob_eh_handler_addr, aarch64_post_frob_update_context):
	Rename RA_A_SIGNED_BIT to RA_SIGNED_BIT.
	* unwind-dw2-fde.c (get_cie_encoding): Add check for 'B' in augmentation
	string.
	* unwind-dw2.c (extract_cie_info): Add check for 'B' in augmentation
	string.
	(RA_A_SIGNED_BIT): Rename to RA_SIGNED_BIT.

From-SVN: r271735
2019-05-29 09:22:17 +00:00
Rainer Orth e54b1a92ac Remove pre-Solaris 11/SPARC unwinding support
* config/sparc/sol2-unwind.h [__arch64__] (sparc64_is_sighandler):
	Remove Solaris 9 and 10 support.
	(sparc_is_sighandler): Likewise.

From-SVN: r271715
2019-05-28 17:27:51 +00:00
John David Anglin abbb83070a linux-unwind.h (pa32_fallback_frame_state): Add cast.
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast.

From-SVN: r271631
2019-05-26 15:16:50 +00:00
H.J. Lu 2581344df6 soft-fp: Update soft-fp from glibc
This patch is updating all soft-fp from glibc, most changes are
copyright years update, and changes other than years update are

	* soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if
	4_FP_W_TYPEs are used for IEEE quad precision.
	* soft-fp/extendhftf2.c: Likewise.
	* soft-fp/extendsftf2.c: Likewise.
	* soft-fp/extendxftf2.c: Likewise.
	* soft-fp/trunctfdf2.c: Likewise.
	* soft-fp/trunctfhf2.c: Likewise.
	* soft-fp/trunctfsf2.c: Likewise.
	* soft-fp/trunctfxf2.c: Likewise.
	* config/rs6000/ibm-ldouble.c: Likewise.

From-SVN: r271327
2019-05-17 07:37:39 -07:00
Rainer Orth ccd1242eec Remove obsolete Solaris 10 support
libstdc++-v3:
	* config/os/solaris/solaris2.10: Move to ...
	* config/os/solaris: ... this.
	* configure.host (os_include_dir): Adapt.
	(abi_baseline_pair): Remove Solaris 10 handling.
	* config/abi/post/i386-solaris2.10: Remove.
	* config/abi/post/sparc-solaris2.10: Remove.
	* config/abi/post/i386-solaris2.11: Rename to ...
	* config/abi/post/i386-solaris: ... this.
	* config/abi/post/sparc-solaris2.11: Rename to ...
	* config/abi/post/sparc-solaris: ... this.

	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] [__sun]: Remove
	workaround.

	* testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.10
	xfail.

	libsanitizer:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	libgcc:
	* config.host: Simplify various *-*-solaris2.1[0-9]* to
	*-*-solaris2*.
	* configure.ac: Likewise.
	* configure: Regenerate.

	* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
	Solaris 10 and Solaris 11 < snv_125 handling.

	libbacktrace:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	gcc/testsuite:
	* gcc.dg/atomic/c11-atomic-exec-4.c: Simplify triplet to
	*-*-solaris2*.
	* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
	* gcc.dg/c99-math-double-1.c: Likewise.
	* gcc.dg/c99-math-float-1.c: Likewise.
	* gcc.dg/c99-math-long-double-1.c: Likewise.
	* gcc.misc-tests/linkage.exp: Simplify triplet to
	x86_64-*-solaris2*.

	* gcc.target/i386/mcount_pic.c: Remove *-*-solaris2.10* && !gld
	xfail.
	* gcc.target/i386/pr63620.c: Likewise.

	* lib/target-supports.exp (check_sse_os_support_available): Remove
	Solaris 9/x86 workaround.

	gcc:
	* config.gcc: Move *-*-solaris2.10* from obsolete configurations
	to unsupported ones.
	Simplify x86_64-*-solaris2.1[0-9]* to x86_64-*-solaris2*.
	* config.host: Likewise.
	* config/i386/sol2.h (ASM_COMMENT_START): Remove.
	* config/sparc/driver-sparc.c (host_detect_local_cpu) [__sun__ &&
	__svr4__]: Remove "brand" fallback.
	[!KSTAT_DATA_STRING]: Remove.
	* configure.ac (gcc_cv_ld_hidden): Simplify *-*-solaris2.1[0-9]*
	to *-*-solaris2*.
	(comdat_group): Likewise.
	(set_have_as_tls): Likewise.
	(gcc_cv_target_dl_iterate_phdr): Likewise.
	(gcc_cv_as_shf_merge): Remove Solaris 10/x86 workaround.
	(gcc_cv_ld_aligned_shf_merge): Remove Solaris 10/SPARC workaround.
	* configure: Regenerate.
	* doc/install.texi: Simplify Solaris target triplets.
	(Specific, i?86-*-solaris2*): Remove Solaris 10 references.
	(Specific, *-*-solaris2*): Document Solaris 10 removal.
	Remove Solaris 10 references.
	Remove obsolete Solaris bug reference.
	(Specific, sparc-sun-solaris2.10): Remove.

From-SVN: r271183
2019-05-14 17:17:23 +00:00
Iain Sandoe ef5eb79dfd darwin, powerpc - set .machine in an asm file.
The asm file fails to build if we use a modern assembler
which checks that the machine is consistent with the 
filetype.  Fixed by adjusting in a similar manner to 
other assembler.

libgcc/

2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin-vecsave.S: Set .machine appropriately.

From-SVN: r271111
2019-05-12 19:26:16 +00:00
Hongtao Liu 4f0e90fae9 Enable support for bfloat16 which will be in Future Cooper Lake.
There are 3 instructions for AVX512BF16: VCVTNE2PS2BF16, VCVTNEPS2BF16 and
DPBF16PS instructions, which are Vector Neural Network Instructions
supporting:
    
- VCVTNE2PS2BF16: Convert Two Packed Single Data to One Packed BF16 Data.
- VCVTNEPS2BF16: Convert Packed Single Data to Packed BF16 Data.
- VDPBF16PS: Dot Product of BF16 Pairs Accumulated into Packed Single Precision.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512BF16_SET
	OPTION_MASK_ISA_AVX512BF16_UNSET, OPTION_MASK_ISA2_AVX512BW_UNSET): New.
	(OPTION_MASK_ISA2_AVX512F_UNSET): Add OPTION_MASK_ISA_AVX512BF16_UNSET.
	(ix86_handle_option): Handle -mavx512bf16.
	* config.gcc: Add avx512bf16vlintrin.h and avx512bf16intrin.h
	to extra_headers.
	* config/i386/avx512bf16vlintrin.h: New.
	* config/i386/avx512bf16intrin.h: New.
	* config/i386/cpuid.h (bit_AVX512BF16): New.
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect BF16.
	* config/i386/i386-builtin-types.def: Add new types.
	* config/i386/i386-builtin.def: Add new builtins.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__AVX512BF16__.
	* config/i386/i386-option.c (ix86_target_string): Add -mavx512bf16.
	(ix86_option_override_internal): Handle BF16.
	(ix86_valid_target_attribute_inner_p): Ditto.
	* config/i386/i386-expand.c (ix86_expand_args_builtin): Ditto.
	* config/i386/i386-builtin.c (enum processor_features): Add
	F_AVX512BF16.
	(static const _isa_names_table isa_names_table): Ditto.
	* config/i386/i386.h (TARGET_AVX512BF16, TARGET_AVX512BF16_P): New.
	(PTA_AVX512BF16): Ditto.
	* config/i386/i386.opt: Add -mavx512bf16.
	* config/i386/immintrin.h: Include avx512bf16intrin.h
	and avx512bf16vlintrin.h.
	* config/i386/sse.md (avx512f_cvtne2ps2bf16_<mode><mask_name>,
	avx512f_cvtneps2bf16_<mode><mask_name>,
	avx512f_dpbf16ps_<mode><mask_half_name>): New define_insn patterns.
	* config/i386/subst.md (mask_half): Add new subst.
	* doc/invoke.texi: Document -mavx512bf16.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* gcc.target/i386/avx512bf16-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vdpbf16ps-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vdpbf16ps-1.c: New test.
	* gcc.target/i386/builtin_target.c: Handle avx512bf16.
	* gcc.target/i386/sse-12.c: Add -mavx512bf16.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.

2019-05-07  Hongtao Liu  <hongtao.liu@intel.com>

	* config/i386/cpuinfo.c (get_available_features): Detect BF16.
	* config/i386/cpuinfo.h (enum processor_features): Add
	FEATURE_AVX512BF16.

From-SVN: r271006
2019-05-08 10:21:40 +00:00