Commit Graph

1544 Commits

Author SHA1 Message Date
Jakub Jelinek 73a9216b8a libgcov: Fix build on Darwin [PR99406]
As reported, bootstrap currently fails on older Darwin because MAP_ANONYMOUS
is not defined.

The following is what gcc/system.h does, so I think it should work for
libgcov.

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

	PR gcov-profile/99406
	* libgcov.h (MAP_FAILED, MAP_ANONYMOUS): If HAVE_SYS_MMAN_H is
	defined, define these macros if not defined already.
2021-03-06 16:22:27 +01:00
GCC Administrator 67f10d28f0 Daily bump. 2021-03-05 00:16:21 +00:00
Martin Liska 6a8fc0c31a profiling: fix streaming of TOPN counters
libgcc/ChangeLog:

	PR gcov-profile/99105
	* libgcov-driver.c (write_top_counters): Rename to ...
	(write_topn_counters): ... this.
	(write_one_data): Pre-allocate buffer for number of items
	in the corresponding linked lists.
	* libgcov.h (malloc_mmap): New function.
	(allocate_gcov_kvp): Use it.

gcc/testsuite/ChangeLog:

	PR gcov-profile/99105
	* gcc.dg/tree-prof/indir-call-prof-malloc.c: Use profile
	correction as the wrapped malloc is called one more time
	from libgcov.
	* gcc.dg/tree-prof/pr97461.c: Likewise.
2021-03-04 16:21:52 +01:00
Martin Liska 4c955b4ad3 gcov: call mmap MAP_ANONYMOUS with fd equal to -1
libgcc/ChangeLog:

	PR gcov-profile/99385
	* libgcov.h (allocate_gcov_kvp): Call mmap with fd equal to -1.
2021-03-04 11:53:33 +01:00
GCC Administrator f3641ac70e Daily bump. 2021-03-04 00:16:48 +00:00
Martin Liska 00d79dc4be gcov: use mmap pools for KVP.
gcc/ChangeLog:

	PR gcov-profile/97461
	* gcov-io.h (GCOV_PREALLOCATED_KVP): Remove.

libgcc/ChangeLog:

	PR gcov-profile/97461
	* config.in: Regenerate.
	* configure: Likewise.
	* configure.ac: Check sys/mman.h header file
	* libgcov-driver.c (struct gcov_kvp): Remove static
	pre-allocated pool and use a dynamic one.
	* libgcov.h (MMAP_CHUNK_SIZE): New.
	(gcov_counter_add): Use mmap to allocate pool for struct
	gcov_kvp.
2021-03-03 14:21:45 +01:00
GCC Administrator d97a92dca9 Daily bump. 2021-03-03 00:16:48 +00:00
Michael Meissner 76c99cb113 Fix __sprintfkf prototype in libgcc.
The prototype of __sprintfkf in _sprintfkf.h did not match the function in
_sprintfkf.c.  This patch fixes the prototype.  I also included the
_sprintfkf.h file in _sprintfkf.c to make sure the prototype is correct and to
eliminate a warning about declaring the function without a previous
declaration.

libgcc/
2021-03-01  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/_sprintfkf.h (__sprintfkf): Fix prototype to match
	the function.
	* config/rs6000/_sprintfkf.c: Include _sprintfkf.h.
2021-03-01 22:13:33 -05:00
GCC Administrator 4028d01a05 Daily bump. 2021-02-25 00:16:29 +00:00
Jakub Jelinek 35da095d7e libgcc: Avoid signed negation overflow in __powi?f2 [PR99236]
When these functions are called with integer minimum, there is UB on the libgcc
side.  Fixed in the obvious way, the code in the end wants ABSU_EXPR behavior.

2021-02-24  Jakub Jelinek  <jakub@redhat.com>

	PR libgcc/99236
	* libgcc2.c (__powisf2, __powidf2, __powitf2, __powixf2): Perform
	negation of m in unsigned type.
2021-02-24 20:07:38 +01:00
Christophe Lyon be30dd8992 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.
2021-02-24 16:00:21 +00:00
GCC Administrator 2f5765cf25 Daily bump. 2021-02-23 00:16:34 +00:00
Michael Meissner 692ba083d9 Fix a comment line that was too long.
libgcc/
2021-02-22  Michael Meissner  <meissner@linux.ibm.com>

	* dfp-bit.c (BFP_TO_DFP): Fix a comment line that was too long.
2021-02-22 15:54:39 -05:00
Michael Meissner 781183595a Add conversions between _Float128 and Decimal.
This patch implements conversions between _Float128 and the 3 Decimal floating
types.  It does this by extendending the dfp-bit conversions to add a new
binary floating point type (KF), and doing the conversions in the same manner
as the other binary/decimal conversions.

For conversions from _Float128 to Decimal, this patch uses a function
(__sprintfkf) instead of the sprintf function to convert long double values to
strings.  The __sprintfkf function determines if GLIBC 2.32 or newer is used
and calls the IEEE 128-bit version of sprintf (__sprintfieee128).  If the GLIBC
is earlier than 2.32, the code will convert _Float128 to __ibm128 and then use
the normal sprintf to convert this value.

For conversions from Decimal to _Float128, this patch uses a function
(__strtokf) instead of strtold to convert the strings from the Decimal
conversion to long double.  The __strtokf function determines if GLIBC 2.32 or
newer is used, and if it is, calls the IEEE 128-bit version (__strtoieee128).
If the GLIBC is earlier than 2.32, the code will call strtold and convert the
__ibm128 value to _Float128.

These functions will primarily be used if/when the default PowerPC long double
type is changed to IEEE 128-bit, but they could also be used if the user
explicitly converts _Float128 to/from a Decimal type.

libgcc/
2021-02-22  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/_dd_to_kf.c: New file.
	* config/rs6000/_kf_to_dd.c: New file.
	* config/rs6000/_kf_to_sd.c: New file.
	* config/rs6000/_kf_to_td.c: New file.
	* config/rs6000/_sd_to_kf.c: New file.
	* config/rs6000/_sprintfkf.c: New file.
	* config/rs6000/_sprintfkf.h: New file.
	* config/rs6000/_strtokf.h: New file.
	* config/rs6000/_strtokf.c: New file.
	* config/rs6000/_td_to_kf.c: New file.
	* config/rs6000/quad-float128.h: Add new declarations.
	* config/rs6000/t-float128 (fp128_dec_funcs): New macro.
	(fp128_decstr_funcs): New macro.
	(ibm128_dec_funcs): New macro.
	(fp128_ppc_funcs): Add the new conversions.
	(fp128_dec_objs): Force Decimal <-> __float128 conversions to be
	compiled with -mabi=ieeelongdouble.
	(fp128_decstr_objs): Force __float128 <-> string conversions to be
	compiled with -mabi=ibmlongdouble.
	(ibm128_dec_objs): Force Decimal <-> __float128 conversions to be
	compiled with -mabi=ieeelongdouble.
	(FP128_CFLAGS_DECIMAL): New macro.
	(IBM128_CFLAGS_DECIMAL): New macro.
	* dfp-bit.c (DFP_TO_BFP): Add PowerPC _Float128 support.
	(BFP_TO_DFP): Add PowerPC _Float128 support.
	* dfp-bit.h (BFP_KIND): Add new binary floating point kind for
	IEEE 128-bit floating point.
	(DFP_TO_BFP): Add PowerPC _Float128 support.
	(BFP_TO_DFP): Add PowerPC _Float128 support.
	(BFP_SPRINTF): New macro.
2021-02-22 15:33:29 -05:00
GCC Administrator aa69f0a820 Daily bump. 2021-01-28 00:16:56 +00:00
Jakub Jelinek 686b1cdfdc libgcc, i386: Add .note.GNU-stack sections to the ms sse/avx sav/res
On Linux, GCC emits .note.GNU-stack sections when compiling code to mark
the code as not needing or needing executable stack, missing section means
unknown.  But assembly files need to be marked manually.  We already
mark various *.S files in libgcc manually, but the
avx_resms64f.o
avx_resms64fx.o
avx_resms64.o
avx_resms64x.o
avx_savms64f.o
avx_savms64.o
sse_resms64f.o
sse_resms64fx.o
sse_resms64.o
sse_resms64x.o
sse_savms64f.o
sse_savms64.o
files aren't marked, so when something links it in, it will require
executable stack.  Nothing in the assembly requires executable stack though.

2021-01-27  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/savms64.h: Add .note.GNU-stack section on Linux.
	* config/i386/savms64f.h: Likewise.
	* config/i386/resms64.h: Likewise.
	* config/i386/resms64f.h: Likewise.
	* config/i386/resms64x.h: Likewise.
	* config/i386/resms64fx.h: Likewise.
2021-01-27 11:50:13 +01:00
GCC Administrator e62bb7f083 Daily bump. 2021-01-27 00:16:33 +00:00
Martin Liska d40b21eebc libgcov: improve profile reproducibility
libgcc/ChangeLog:

	PR gcov-profile/98739
	* libgcov.h (gcov_topn_add_value): Do not train when
	we have a merged profile with a negative number of total
	value.
2021-01-26 12:44:34 +01:00
GCC Administrator 161e4c0862 Daily bump. 2021-01-26 00:16:34 +00:00
Martin Liska 5089df534b Restore profile reproducibility.
gcc/ChangeLog:

	PR gcov-profile/98739
	* common.opt: Add missing sign symbol.
	* value-prof.c (get_nth_most_common_value): Restore handling
	of PROFILE_REPRODUCIBILITY_PARALLEL_RUNS and
	PROFILE_REPRODUCIBILITY_MULTITHREADED.

libgcc/ChangeLog:

	PR gcov-profile/98739
	* libgcov-merge.c (__gcov_merge_topn): Mark when merging
	ends with a dropped counter.
	* libgcov.h (gcov_topn_add_value): Add return value.
2021-01-25 13:30:34 +01:00
GCC Administrator be0851b8e9 Daily bump. 2021-01-14 00:16:24 +00:00
Stafford Horne b77f6d2fa8 or1k: Support for softfloat to emulate hw exceptions
This allows the openrisc softfloat implementation to set exceptions.
This also sets the correct tininess after rounding value to be
consistent with hardware and simulator implementations.

libgcc/ChangeLog:

	* config/or1k/sfp-machine.h (FP_RND_NEAREST, FP_RND_ZERO,
	FP_RND_PINF, FP_RND_MINF, FP_RND_MASK, FP_EX_OVERFLOW,
	FP_EX_UNDERFLOW, FP_EX_INEXACT, FP_EX_INVALID, FP_EX_DIVZERO,
	FP_EX_ALL): New constant macros.
	(_FP_DECL_EX, FP_ROUNDMODE, FP_INIT_ROUNDMODE,
	FP_HANDLE_EXCEPTIONS): New macros.
	(_FP_TININESS_AFTER_ROUNDING): Change to 1.
2021-01-14 08:45:01 +09:00
Samuel Thibault 2b356e689c 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.
2021-01-13 11:54:54 +01:00
Jakub Jelinek 99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Jakub Jelinek c48514bea6 Update Copyright in ChangeLog files
Do this separately from all other Copyright updates, as ChangeLog files
can be modified only separately.
2021-01-04 09:35:45 +01:00
GCC Administrator 108beb75da Daily bump. 2020-12-21 00:16:20 +00:00
Max Filippov 18e86fae2a gcc: xtensa: implement bswapsi2, bswapdi2 and helpers
2020-12-20  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.md (bswapsi2, bswapdi2): New patterns.

gcc/testsuite/
	* gcc.target/xtensa/bswap.c: New test.

libgcc/
	* config/xtensa/lib1funcs.S (__bswapsi2, __bswapdi2): New
	functions.
	* config/xtensa/t-xtensa (LIB1ASMFUNCS): Add _bswapsi2 and
	_bswapdi2.
2020-12-20 14:02:26 -08:00
GCC Administrator f6e8e2797e Daily bump. 2020-12-09 00:16:50 +00:00
Ian Lance Taylor f41dd93ade libgcc: block signals when releasing split-stack memory
* generic-morestack-thread.c (free_segments): Block signals during
	thread exit.
2020-12-08 10:17:48 -08:00
GCC Administrator b8dd0ef74d Daily bump. 2020-12-04 00:16:36 +00:00
Michael Meissner 9f1a650199 PowerPC: PR libgcc/97543 and libgcc/97643, fix long double issues
If you use a compiler with long double defaulting to 64-bit instead of 128-bit
with IBM extended double, you get linker warnings about mis-matches in the gnu
attributes for long double (PR libgcc/97543).  Even if the compiler is
configured to have long double be 64 bit as the default with the configuration
option '--without-long-double-128' you get the warnings.

You also get the same issues if you use a compiler with long double defaulting
to IEEE 128-bit instead of IBM extended double (PR libgcc/97643).

The issue is the way libgcc.a/libgcc.so is built.  Right now when building
libgcc under Linux, the long double size is set to 128-bits when building
libgcc.  However, the gnu attributes are set, leading to the warnings.

One feature of the current GNU attribute implementation is if you have a shared
library (such as libgcc_s.so), the GNU attributes for the shared library is an
inclusive OR of all of the objects within the library.  This means if any
object file that uses the -mlong-double-128 option and uses long double, the GNU
attributes for the library will indicate that it uses 128-bit IBM long
doubles.  If you have a static library, you will get the warning only if you
actually reference an object file  with the attribute set.

This patch does two things:

    1)	All of the object files that support IBM 128-bit long doubles
	explicitly set the ABI to IBM extended double.

    2)	I turned off GNU attributes for building the shared library or for
        building the IBM 128-bit long double support.

libgcc/
2020-12-03  Michael Meissner  <meissner@linux.ibm.com>

	PR libgcc/97543
	PR libgcc/97643
	* config/rs6000/t-linux (IBM128_STATIC_OBJS): 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.
2020-12-03 14:50:26 -05:00
Alexandre Oliva c05ece92c6 introduce overridable clear_cache emitter
This patch introduces maybe_emit_call_builtin___clear_cache for the
builtin expander machinery and the trampoline initializers to use to
clear the instruction cache, removing a source of inconsistencies and
subtle errors in low-level machinery.

I've adjusted all trampoline_init implementations that used to issue
explicit calls to __clear_cache or similar to use this new primitive.


Specifically on vxworks targets, we needed to drop the __clear_cache
symbol in libgcc, for reasons related with linking that I didn't need
to understand, and we wanted to call cacheTextUpdate directly, despite
the different calling conventions: the second argument is a length
rather than the end address.

So I introduced a target hook to enable target OS-level overriding of
builtin __clear_cache call emission, retaining nearly (*) the same
logic to govern the decision on whether to emit a call (or nothing, or
a machine-dependent insn) but enabling a call to a target
system-defined function with different calling conventions to be
issued, without having to modify .md files of the various
architectures supported by the target system to introduce or modify
clear_cache insns.

(*) I write "nearly" mainly because, when not optimizing, we'd issue a
call regardless, but since the call may now be overridden, I added it
to the set of builtins that are not directly turned into calls when
not optimizing, following the normal expansion path instead.  It
wouldn't be hard to skip the emission of cache-clearing insns when not
optimizing, but it didn't seem very important, especially for the new
uses from trampoline init.

    Another difference that might be relevant is that now we expand
the begin and end arguments unconditionally.  This might make a
difference if they have side effects.  That's prettty much impossible
at expand time, but I thought I'd mention it.


I have NOT modified targets that did not issue cache-clearing calls in
trampoline init to use the new clear_cache-calling infrastructure even
if it would expand to nothing.  I have considered doing so, to have
__builtin___clear_cache and trampoline init call cacheTextUpdate on
all vxworks targets, but decided not to, since on targets that don't
do any cache clearing, cacheTextUpdate ought to be a no-op, even
though rs6000 seems to use icbi and dcbf instructions in the function
called to initialize a trampoline, but AFAICT not in the __clear_cache
builtin.  Hopefully target maintainers will have a look and take
advantage of this new piece of infrastructure to remove such
(apparent?) inconsistencies.  Not rs6000 and other that call asm-coded
trampoline setup instructions, for sure, but they might wish to
introduce a CLEAR_INSN_CACHE macro or a clear_cache expander if they
don't have one.


for  gcc/ChangeLog

	* builtins.c (default_emit_call_builtin___clear_cache): New.
	(maybe_emit_call_builtin___clear_cache): New.
	(expand_builtin___clear_cache): Split into the above.
	(expand_builtin): Do not issue clear_cache call any more.
	* builtins.h (maybe_emit_call_builtin___clear_cache): Declare.
	* config/aarch64/aarch64.c (aarch64_trampoline_init): Use
	maybe_emit_call_builtin___clear_cache.
	* config/arc/arc.c (arc_trampoline_init): Likewise.
	* config/arm/arm.c (arm_trampoline_init): Likewise.
	* config/c6x/c6x.c (c6x_initialize_trampoline): Likewise.
	* config/csky/csky.c (csky_trampoline_init): Likewise.
	* config/m68k/linux.h (FInALIZE_TRAMPOLINE): Likewise.
	* config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise.
	* config/tilepro/tilepro.c (tilepro_trampoline_init): Ditto.
	* config/vxworks.c: Include rtl.h, memmodel.h, and optabs.h.
	(vxworks_emit_call_builtin___clear_cache): New.
	* config/vxworks.h (CLEAR_INSN_CACHE): Drop.
	(TARGET_EMIT_CALL_BUILTIN___CLEAR_CACHE): Define.
	* target.def (trampoline_init): In the documentation, refer to
	maybe_emit_call_builtin___clear_cache.
	(emit_call_builtin___clear_cache): New.
	* doc/tm.texi.in: Add new hook point.
	(CLEAR_CACHE_INSN): Remove duplicate 'both'.
	* doc/tm.texi: Rebuilt.
	* targhooks.h (default_meit_call_builtin___clear_cache):
	Declare.
	* tree.h (BUILTIN_ASM_NAME_PTR): New.

for  libgcc/ChangeLog

	* config/t-vxworks (LIB2ADD): Drop.
	* config/t-vxworks7 (LIB2ADD): Likewise.
	* config/vxcache.c: Remove.
2020-12-02 22:10:32 -03:00
GCC Administrator 94358e4770 Daily bump. 2020-12-01 00:16:38 +00:00
Stefan Kanthak a8ae23920f fixed _bswapsi2 function
libgcc

	* libgcc2.c (bswapsi2): Make constants unsigned.
2020-11-29 18:05:46 -07:00
GCC Administrator 360258daf5 Daily bump. 2020-11-26 00:16:41 +00:00
Stefan Kanthak 4919ed711c Improve abs with overflow implementations
libgcc/

	* libgcc2.c (absvSI2): Simplify/improve implementation by using
	builtin_add_overflow.
	(absvsi2, absvDI2): Likewise.
2020-11-25 11:38:46 -07:00
GCC Administrator 82e5048e70 Daily bump. 2020-11-21 00:16:29 +00:00
Maciej W. Rozycki f50c417a03 NetBSD/libgcc: Check for TARGET_DL_ITERATE_PHDR in the unwinder
Disable USE_PT_GNU_EH_FRAME frame unwinder support for old OS versions,
fixing compilation errors:

.../libgcc/unwind-dw2-fde-dip.c:75:21: error: unknown type name 'Elf_Phdr'
   75 | # define ElfW(type) Elf_##type
      |                     ^~~~
.../libgcc/unwind-dw2-fde-dip.c:132:9: note: in expansion of macro 'ElfW'
  132 |   const ElfW(Phdr) *p_eh_frame_hdr;
      |         ^~~~
.../libgcc/unwind-dw2-fde-dip.c:75:21: error: unknown type name 'Elf_Phdr'
   75 | # define ElfW(type) Elf_##type
      |                     ^~~~
.../libgcc/unwind-dw2-fde-dip.c:133:9: note: in expansion of macro 'ElfW'
  133 |   const ElfW(Phdr) *p_dynamic;
      |         ^~~~
.../libgcc/unwind-dw2-fde-dip.c:165:37: warning: 'struct dl_phdr_info' declared inside parameter list will not be visible outside of this definition or declaration
  165 | _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
      |                                     ^~~~~~~~~~~~
[...]

and producing a working cross-compiler at least with VAX/NetBSD 1.6.2.

	libgcc/
	* unwind-dw2-fde-dip.c [__OpenBSD__ || __NetBSD__]
	(USE_PT_GNU_EH_FRAME): Do not define if !TARGET_DL_ITERATE_PHDR.
2020-11-20 21:11:22 +00:00
GCC Administrator 25bb75f841 Daily bump. 2020-11-19 00:16:30 +00:00
Jozef Lawrynowicz bf7b94d407 MSP430: Add 64-bit hardware multiply support
Hardware multipliers that support widening 32-bit multiplication can
be used to perform a 64-bit * 64-bit multiplication more efficiently
than a software implementation.

The following equation is used to perform 64-bit multiplication for
devices with "32bit" or "f5series" hardware multiply versions:

  64bit_result = (low32_op0 * lop32_op1)
    + ((low32_op0 * high32_op1) << 32)
       + ((high32_op0 * low32_op1) << 32)

libgcc/ChangeLog:

	* config/msp430/lib2hw_mul.S (mult64_hw): New.
	(if MUL_32): Use mult64_hw for __muldi3.
	(if MUL_F5): Use mult64_hw for __muldi3.
	* config/msp430/lib2mul.c (__muldi3): New.
	* config/msp430/t-msp430 (LIB2FUNCS_EXCLUDE): Define.
2020-11-18 11:05:27 +00:00
GCC Administrator 29c5d9ceb9 Daily bump. 2020-11-17 00:16:27 +00:00
Alan Modra 948ef14225 [RS6000] Use LIB2_SIDITI_CONV_FUNCS in place of ppc64-fp.c
This patch retires ppc64-fp.c in favour of using
"LIB2_SIDITI_CONV_FUNCS = yes", which is a lot better solution than
having a copy of selected libgcc2.c functions.

	* config/rs6000/t-ppc64-fp (LIB2ADD): Delete.
	(LIB2_SIDITI_CONV_FUNCS): Define.
	* config/rs6000/ppc64-fp.c: Delete file.
2020-11-17 10:39:01 +10:30
GCC Administrator cba306519c Daily bump. 2020-11-16 00:16:31 +00:00
Jozef Lawrynowicz c746fc40f4 MSP430: Fix inconsistent naming of hwmult libfuncs
The naming scheme used by GCC to reference MSP430 hardware multiply
library functions is inconsistent.

Sometimes the "GCC" names (e.g. mulsi2) are used, other times the
"MSPABI" names (e.g. __mspabi_mpyl) are used.

Also, sometimes an identifier for the hardware multiply support is
appended to the GCC name, when the functions are defined, but this is
not required.

This patch fixes those issues, so the names used to refer to the
hardware multiply library functions follow a consistent pattern.

gcc/ChangeLog:

	* config/msp430/msp430.c (msp430_output_labelref): Don't process mspabi
	hwmult library function names into GCC-style names.

libgcc/ChangeLog:

	* config/msp430/lib2hw_mul.S: Omit _hw* suffix from GCC names for
	hwmult library functions.

gcc/testsuite/ChangeLog:

	* gcc.target/msp430/rtx-cost-Os-f5series.c: Adjust test to use new
	hwmult library function name.
2020-11-15 21:04:56 +00:00
GCC Administrator bb6226419f Daily bump. 2020-11-11 00:16:36 +00:00
Jeff Law 831f24a778 Fix minor whitespace issues
libgcc/

	* libgcc2.c: Fix whitespace issues in most recent change.
2020-11-10 09:07:51 -07:00
Stefan Kanthak ebc4cd54b2 Improve generated code for various libgcc2.c routines
libgcc/

	* libgcc2.c (__addvSI3): Use overflow builtins.
	(__addvsi3, __addvDI3 ,__subvSI3, __subvsi3): Likewise.
	(__subvDI3 __mulvSI3, __mulvsi3, __negvSI2): Likewise.
	(__negvsi2, __negvDI2): Likewise.
	(__cmpdi2, __ucmpdi2): Adjust implementation to improve
	generated code.
	* libgcc2.h (__ucmpdi2): Adjust prototype.
2020-11-10 08:29:46 -07:00
GCC Administrator fd2325ea60 Daily bump. 2020-11-04 00:16:41 +00:00
Pat Bernardi ec4d374ece Sync the aarch64-vx7r2 libgcc config with that of Linux
This adds ${cpu_type}/t-lse and t-slibgcc-libgcc to the tmake_file
list for aarch64-vxworks7* configurations, as the Linux port does.

t-lse is needed by all triplets now anyway and the standard setting
for slibgcc makes sense as we are working on reintroducing PIC support
for RTPs on various targets. The VxWorks7 system environments are leaning
towards more and more similarilties with Linux in general, so the
closer configurations the better.

2020-11-02  Pat Bernardi  <bernardi@adacore.com>

libgcc/
	* config.host (aarch64-vxworks7*, tmake_file): Add
	${cpu_type}/t-lse and t-slibgcc-libgcc.

Co-authored-by: Olivier Hainque  <hainque@adacore.com>
2020-11-03 17:33:17 +00:00
Martin Storsjö bd6ecbe48a libgcc: Expose the instruction pointer and stack pointer in SEH _Unwind_Backtrace
Previously, the SEH version of _Unwind_Backtrace did unwind
the stack and call the provided callback function as intended,
but there was little the caller could do within the callback to
actually get any info about that particular level in the unwind.

Set the ra and cfa pointers, which are used by _Unwind_GetIP
and _Unwind_GetCFA, to allow using these functions from the
callacb to inspect the state at each stack frame.

2020-09-08  Martin Storsjö  <martin@martin.st>

	libgcc/
	* unwind-seh.c (_Unwind_Backtrace): Set the ra and cfa pointers
	before calling the callback.
2020-11-03 00:30:35 +00:00
GCC Administrator 88ce3d5fbb Daily bump. 2020-11-02 20:53:00 +00:00
Olivier Hainque 9a835ba4c0 Introduce support for vxworks7r2 on x86 and x86_64
This change extends the VxWorks support on intel CPUs to
VxWorks7r2 for x86_64 as well as x86, with a "mcmodel=large"
additional multilib for the 64bit configuration.

The support for fPIC is not functional yet for this model,
so we just don't add the corresponding multilib.

We extend the range of CPU families handled by TARGET_OS_CPP_BUILTINS,
accounting for the fact that archs older than PENTIUM4 are
not supported (any more) by VxWorks 7.

As we did for powerpc, we leverage VX_CPU_PREFIX to emit different
forms of definitions for different families of VxWorks as the system
headers's expectations has evolved between Vx 5, 6 and 7.

2020-10-27  Olivier Hainque  <hainque@adacore.com>

gcc/
	* config.gcc: Adjust the ix86/x86_64-wrs-vxworks filters
	to apply to VxWorks 7 as well.
	* config/i386/t-vxworks (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
	Remove the fPIC multilib and add one for the large code model
	on x86_64.
	* config/i386/vxworks.h: Separate sections for TARGET_VXWORKS7,
	other variants and common bits.
	(TARGET_OS_CPP_BUILTINS): Augment to support a range of CPU
	families. Leverage VX_CPU_PREFIX.
	(CC1_SPEC): Add definition.
	(STACK_CHECK_PROTECT): Use conditional expression instead of
	heavier to read conditioned macro definitions.

libgcc/
	* config.host: Adjust the ix86/x86_64-wrs-vxworks filters
	to apply to VxWorks 7 as well.

Co-authored-by: Douglas Rupp <rupp@adacore.com>
Co-authored-by: Pat Bernardi <bernardi@adacore.com>
2020-10-30 08:25:26 +00:00
GCC Administrator 4f0606fe4b Daily bump. 2020-10-30 00:16:29 +00:00
Olivier Hainque 9df44b9403 Fix the logic conditioning VX_ENTER/LEAVE_TLS_DTOR
Fix a basic #if/#ifdef confusion which leads to improper
choices in some configurations.

2020-10-28  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config/gthr-vxworks-tls.c: Fix preprocessor logic
	controlling the definition of VX_ENTER_TLS_DTOR and
	VX_LEAVE_TLS_DTOR based on a version major check.
2020-10-29 10:59:11 +00:00
Olivier Hainque 291d920395 Fix conditional inclusion guard in gthr-vxworks-thread.c
This fixes the name of the macro used to condition the
inclusion of an actual implementation of some of the gthread
support services for VxWorks, to agree with the side
defining that macro based on tests against the targetted
VxWorks version major.

2020-10-28  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config/gthr-vxworks-thread.c: Fix name of macro used
	to condition the inclusion of an actual implementation.
2020-10-29 10:59:11 +00:00
GCC Administrator 89bb01e7cb Daily bump. 2020-10-28 00:16:38 +00:00
Martin Liska 14e19b82c1 gcov-profile: use static pool for TOPN first
gcc/ChangeLog:

	PR gcov-profile/97461
	* gcov-io.h (GCOV_PREALLOCATED_KVP): Pre-allocate 64
	static counters.

libgcc/ChangeLog:

	PR gcov-profile/97461
	* libgcov.h (gcov_counter_add): Use first static counters
	as it should help to have malloc wrappers set up.

gcc/testsuite/ChangeLog:

	PR gcov-profile/97461
	* gcc.dg/tree-prof/pr97461.c: New test.
2020-10-27 11:49:54 +01:00
GCC Administrator efe71fcc4c Daily bump. 2020-10-24 00:16:29 +00:00
Rasmus Villemoes ad1a9afc60 Fix overzealous gthread support inhibition for vxworks
The tests for macros possibly defined in gthr.h needs to
be performed after the corresponding #include. This was tested
together with the previous updates to gthr-vxworks-thread.c
and gthr-vxworks-cond.c and was meant to be squashed with them.

2010-10-23  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks-thread.c: #include gthr.h before
	testing the guard defined there.
	* config/gthr-vxworks-cond.c: Likewise.
2020-10-23 15:23:33 +00:00
Jakub Jelinek 50bc94898f stor-layout: Reject forming arrays with elt sizes not divisible by elt alignment [PR97164]
As mentioned in the PR, since 2005 we reject if array elements are smaller
than their alignment (i.e. overaligned elements), because such arrays don't
make much sense, only their first element is guaranteed to be aligned as
user requested, but the next element can't be.
The following testcases show something we've been silent about but is
equally bad, the 2005 case is just the most common special case of that
the array element size is not divisible by the alignment.  In those arrays
too only the first element is guaranteed to be properly aligned and the
second one can't be.

This patch rejects those cases too, but keeps the existing wording for the
old common case.

Unfortunately, the patch breaks bootstrap, because libbid uses this mess
(forms arrays with 24 byte long elements with 16 byte element alignment).
I don't really see justification for that, so I've decreased the alignment
to 8 bytes instead.

2020-10-23  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/97164
gcc/
	* stor-layout.c (layout_type): Also reject arrays where element size
	is constant, but not a multiple of element alignment.
gcc/testsuite/
	* c-c++-common/pr97164.c: New test.
	* gcc.c-torture/execute/pr36093.c: Move ...
	* gcc.dg/pr36093.c: ... here.  Add dg-do compile and dg-error
	directives.
	* gcc.c-torture/execute/pr43783.c: Move ...
	* gcc.dg/pr43783.c: ... here.  Add dg-do compile, dg-options and
	dg-error directives.
libgcc/config/libbid/
	* bid_functions.h (UINT192): Decrease alignment to 8 bytes.
2020-10-23 10:07:36 +02:00
GCC Administrator 56ddd5e23a Daily bump. 2020-10-22 08:28:22 +00:00
Douglas Rupp 1786798090 Introduce vxworks7r2 support for ppc and ppc64
This change introduces support for the most recent versions
of VxWorks on PowerPC targets, for both 32 and 64 bit thanks
to a bi-arch setup.

The system compilers are essentially configured as Linux
toolchains with only a few specificities and we replicate
that model here.

The most visible specificities are the use of secureplt by
default, the pre-definition of some macros that the system
headers still rely on (_VX_CPU and _VX_CPU_FAMILY, for example),
and of course some variations related to the so VxWorks typical
kernel vs RTP mode distinction.

In addition to the introduction of config.gcc and libgcc
configuration chunks, much inspired by the linux ones, the
change

- Reworks rs6000/vxworks.h file to feature bits common to the
  Vx6 and Vx7 port then a separate section for each, where the
  Vx7 part is very short as we rely on the Linux definitions
  for most things.

- Adjusts the CPU macro predefinitions in CPP_SPEC to resort
  to "_VX_CPU" instead of "CPU" for Vx7, to better match the
  more recent system headers expectations,

- Adds a cpu definition case for e6500.

- Changes to the use SUB3TARGET_OVERRIDE_OPTIONS instead of
  SUBSUBTARGET_OVERRIDE_OPTIONS for specifics, so we don't
  override the Linux's version of the latter for vx7.

2020-10-20  Douglas Rupp  <rupp@adacore.com>

gcc/
	* config.gcc (powerpc*-wrs-vxworks7r*): New case.
	* config/rs6000/vxworks.h: Rework to handle VxWorks7.
	Refactor as common bits + vx6 vs vx7 ones. For the
	latter, rely essentially on the Linux configuration
	and adjust CPU to _VX_CPU in CPP_SPEC. Add a case
	for e6500. Use SUB3TARGET_OVERRIDE_OPTIONS for specifics
	to preserve the Linux SUBSUBTARGET_OVERRIDE_OPTIONS
	for vx7.

libgcc/
	* config.host (powerpc*-wrs-vxworks7*): New case.
	* configure.ac: Handle powerpc*-*-vxworks7* as
	powerpc*-*-linux* for ppc-fp_type.
	* configure: Regenerate.

Co-authored-by: Olivier Hainque <hainque@adacore.com>
2020-10-21 16:26:37 +00:00
GCC Administrator 56e4eee935 Daily bump. 2020-10-17 00:16:29 +00:00
Rasmus Villemoes a6590686f7 Inhibit support for C++0x threads on VxWorks < 6
As for condition variables, the C++0x threads support relies on
VxWorks entry points not available in VxWorks versions prior to 6.

We just expose absence of support for C++0x threads on such systems.

2020-10-15  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks.h: Condition the ___GTHREADS_CXX0X
	section on VxWorks >= 6.
	* config/gthr-vxworks-thread.c: Condition the entire
	implementation on __GTHREAD_CXX0X.
2020-10-16 16:16:17 +00:00
Rasmus Villemoes e94d5836e5 Inhibit support for gthread condvars on VxWorks < 6
The condition variables support relies on kernel entry points
to enforce critical aspects of it's expected behavior.

Some of these entry points are not available prior to VxWorks 6,
so we just expose absence of support for condition variables on
such systems.

2020-10-15  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks.h: Condition the __GTHREAD_HAS_COND
	section on VxWorks >= 6.
	* config/gthr-vxworks-cond.c: Condition the entire
	implementation on __GTHREAD_HAS_COND.
2020-10-16 16:14:52 +00:00
Rasmus Villemoes 0aeeda8fc2 Add missing #include <taskLib.h> in gthr-vxworks.c
This fixes an oversight and addresses a few build time warnings.

2020-10-15  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks.c: #include <taskLib.h>.
2020-10-16 16:14:52 +00:00
Rasmus Villemoes 21295f44f3 Fix leftover _VXW_PRE_69 in gthr-vxworks.h
2020-10-15  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks.h: Rewrite remaining occurrence
	of _VXW_PRE_69 as _VXWORKS_PRE(6,9).
2020-10-16 16:14:52 +00:00
Rasmus Villemoes 4cde835fd7 Stub out VX_ENTER_TLS_DTOR for VxWorks != 6
As of today, the __gthread_enter/leave entry points are
only meaningful on VxWorks 6. Refactor the VX_ENTER_TLS_DTOR
macros accordingly.

2020-10-15  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/gthr-vxworks-tls.c (VX_ENTER_TLS_DTOR): Nil
	except on VxWorks 6.

Co-authored-by:  Olivier Hainque  <hainque@adacore.com>
2020-10-16 16:14:52 +00:00
Olivier Hainque 2d23fd23bb Fix the vxworks crtstuff handling of kernel/rtp variations
The ports that support RTPs achieve the kernel/rtp compilation
and link distinction through the multilib mechanism.

This patch just removes the bogus explicit extraneous
materialization of this distinction in the common VxWorks
configuration files and leaves the rtp specialization all
to the multilib machinery.

2020-10-15  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config/t-vxcrtstuff: Remove the -kernel/-rtp specialization.

gcc/
	* config/vxworks.h (VX_CRTBEGIN_SPEC): Likewise.
2020-10-16 15:33:35 +00:00
GCC Administrator b2698c21f2 Daily bump. 2020-10-15 00:16:34 +00:00
Alexandre Oliva 8f8cba46b8 Rework the condition variables support for VxWorks
This change reworks the condition variables support for VxWorks
to address the very legit points raised by Rasmus in

 https://gcc.gnu.org/pipermail/gcc/2020-May/232524.html

While some of the issues were taken care of by the use of semFlush,
a few others were indeed calling for adjustments.

We first considered resorting to the condvarLib library available
in VxWorks7. Unfortunately, it is vx7 only and we wanted something working
for at least vx 6.9 as well. It also turned out requiring the use of
recursive mutexes for condVarWait, which seemed unnecessarily constraining.

Instead, this change corrects the sequencing logic in a few places and
leverages the semExchange API to ensure the key atomicity requirement on
cond_wait operations.

2020-10-14  Alexandre Oliva  <oliva@adacore.com>

libgcc/
	* config/gthr-vxworks-thread.c: Include stdlib.h.
	(tls_delete_hook): Prototype it.
	(__gthread_cond_signal): Return early if no waiters.  Consume
	signal in case the semaphore got full.  Use semInfoGet instead
	of kernel-mode-only semInfo.
	(__gthread_cond_timedwait): Use semExchange.  Always take the
	mutex again before returning.
	* config/gthr-vxworks-cond.c (__ghtread_cond_wait): Likewise.
2020-10-14 19:24:45 +00:00
Olivier Hainque 69d6b3f650 Honor $(MULTISUBDIR) in -I directives for libgcc on VxWorks
This is useful to handle ports where we might arrange to use
different sets of fixed headers for different multilibs, typically
for kernel vs rtp modes.

2020-10-14  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config/t-vxworks (LIBGCC2_INCLUDES): Append
	$(MULTISUBDIR) to the -I path for fixed headers, as we
	arrange to have different sets of such headers for different
	multilibs when they are activated.
	* config/t-vxworks7: Likewise.
2020-10-14 17:38:37 +00:00
Olivier Hainque e4b887cb76 Add include-fixed to include search paths for libgcc on VxWorks
The special vxworks rules for the compilation of libgcc had
-I.../gcc/include and not .../gcc/include-fixed, causing build
failure of our arm-vxworks7r2 port because of indirect dependencies
on limits.h.

The omission was just an oversight and this change just adds the
missing -I.

2020-10-14  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config/t-vxworks: Add include-fixed to include search
	paths for libgcc on VxWorks.
	* config/t-vxworks7: Likewise.
2020-10-14 17:38:37 +00:00
GCC Administrator c74a0e82fa Daily bump. 2020-10-10 00:16:26 +00:00
H.J. Lu 59a95143dd x86: Add <x86gprintrin.h>
For sources which can't use any vector instructions, <x86intrin.h> and
<immintrin.h> cannot be included for compiler intrinsics:

$ echo "#include <x86intrin.h>" | gcc -S -O2 -mno-sse -mno-mmx -x c -
In file included from /usr/include/stdlib.h:1013,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/mm_malloc.h:27,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/xmmintrin.h:34,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/immintrin.h:29,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/x86intrin.h:32,
                 from <stdin>:1:
/usr/include/bits/stdlib-float.h: In function ‘atof’:
/usr/include/bits/stdlib-float.h:26:1: error: SSE register return with SSE disabled
   26 | {
      | ^
$

libgcc/config/i386/shadow-stack-unwind.h has a workaround:

/* NB: We need _get_ssp and _inc_ssp from <cetintrin.h>.  But we can't
   include <x86intrin.h> which ends up including <mm_malloc.h>, which
   includes <stdlib.h> and <errno.h> unconditionally.  But we can't
   include any libc system headers unconditionally from libgcc.  Avoid
   including <mm_malloc.h> here by defining _IMMINTRIN_H_INCLUDED.  */
 #define _IMMINTRIN_H_INCLUDED
 #include <cetintrin.h>
 #undef _IMMINTRIN_H_INCLUDED

Add a standalone intrinsic header file, <x86gprintrin.h>, to provide
integer only intrinsics.  All integer only intrinsics are placed in
<x86gprintrin.h>.  <x86intrin.h> and <immintrin.h> simply include
<x86gprintrin.h>.

gcc/

	PR target/97148
	* config.gcc (extra_headers): Add x86gprintrin.h.
	* config/i386/adxintrin.h: Check _X86GPRINTRIN_H_INCLUDED for
	<x86gprintrin.h>.
	* config/i386/bmi2intrin.h: Likewise.
	* config/i386/bmiintrin.h: Likewise.
	* config/i386/cetintrin.h: Likewise.
	* config/i386/cldemoteintrin.h: Likewise.
	* config/i386/clflushoptintrin.h: Likewise.
	* config/i386/clwbintrin.h: Likewise.
	* config/i386/enqcmdintrin.h: Likewise.
	* config/i386/fxsrintrin.h: Likewise.
	* config/i386/ia32intrin.h: Likewise.
	* config/i386/lwpintrin.h: Likewise.
	* config/i386/lzcntintrin.h: Likewise.
	* config/i386/movdirintrin.h: Likewise.
	* config/i386/pconfigintrin.h: Likewise.
	* config/i386/pkuintrin.h: Likewise.
	* config/i386/rdseedintrin.h: Likewise.
	* config/i386/rtmintrin.h: Likewise.
	* config/i386/serializeintrin.h: Likewise.
	* config/i386/tbmintrin.h: Likewise.
	* config/i386/tsxldtrkintrin.h: Likewise.
	* config/i386/waitpkgintrin.h: Likewise.
	* config/i386/wbnoinvdintrin.h: Likewise.
	* config/i386/xsavecintrin.h: Likewise.
	* config/i386/xsaveintrin.h: Likewise.
	* config/i386/xsaveoptintrin.h: Likewise.
	* config/i386/xsavesintrin.h: Likewise.
	* config/i386/xtestintrin.h: Likewise.
	* config/i386/immintrin.h: Include <x86gprintrin.h> instead of
	<fxsrintrin.h>, <xsaveintrin.h>, <xsaveoptintrin.h>,
	<xsavesintrin.h>, <xsavecintrin.h>, <lzcntintrin.h>,
	<bmiintrin.h>, <bmi2intrin.h>, <xtestintrin.h>, <cetintrin.h>,
	<movdirintrin.h>, <sgxintrin.h, <pconfigintrin.h>,
	<waitpkgintrin.h>, <cldemoteintrin.h>, <enqcmdintrin.h>,
	<serializeintrin.h>, <tsxldtrkintrin.h>, <adxintrin.h>,
	<clwbintrin.h>, <clflushoptintrin.h>, <wbnoinvdintrin.h> and
	<pkuintrin.h>.
	(_wbinvd): Moved to config/i386/x86gprintrin.h.
	(_rdrand16_step): Likewise.
	(_rdrand32_step): Likewise.
	(_rdpid_u32): Likewise.
	(_readfsbase_u32): Likewise.
	(_readfsbase_u64): Likewise.
	(_readgsbase_u32): Likewise.
	(_readgsbase_u64): Likewise.
	(_writefsbase_u32): Likewise.
	(_writefsbase_u64): Likewise.
	(_writegsbase_u32): Likewise.
	(_writegsbase_u64): Likewise.
	(_rdrand64_step): Likewise.
	(_ptwrite64): Likewise.
	(_ptwrite32): Likewise.
	* config/i386/x86gprintrin.h: New file.
	* config/i386/x86intrin.h: Include <x86gprintrin.h>.  Don't
	include <ia32intrin.h>, <lwpintrin.h>, <tbmintrin.h>,
	<popcntintrin.h>, <mwaitxintrin.h> and <clzerointrin.h>.

gcc/testsuite/

	* gcc.target/i386/avx-1.c (__builtin_ia32_lwpval32): New to
	support <lwpintrin.h> included in <x86gprintrin.h>.
	(__builtin_ia32_lwpval64): Likewise.
	(__builtin_ia32_lwpins32): Likewise.
	(__builtin_ia32_lwpins64): Likewise.
	(__builtin_ia32_bextri_u32): New to support <tbmintrin.h>
	included in <x86gprintrin.h>.
	(__builtin_ia32_bextri_u64): Likewise.
	* gcc.target/i386/x86gprintrin-1.c: New test.
	* gcc.target/i386/x86gprintrin-2.c: Likewise.
	* gcc.target/i386/x86gprintrin-3.c: Likewise.
	* gcc.target/i386/x86gprintrin-4.c: Likewise.
	* gcc.target/i386/x86gprintrin-4a.c: Likewise.
	* gcc.target/i386/x86gprintrin-5.c: Likewise.
	* gcc.target/i386/x86gprintrin-5a.c: Likewise.
	* gcc.target/i386/x86gprintrin-5b.c: Likewise.
	* gcc.target/i386/x86gprintrin-6.c: Likewise.

libgcc/

	PR target/97148
	* config/i386/shadow-stack-unwind.h: Include <x86gprintrin.h>
	instead of <cetintrin.h>.
2020-10-09 05:08:41 -07:00
GCC Administrator 6c2675fa2b Daily bump. 2020-10-02 00:16:27 +00:00
Alan Modra 2dd7b93778 [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.
2020-10-01 10:34:48 +09:30
Alan Modra c6be439b37 [RS6000] -mno-minimal-toc vs. power10 pcrelative
We've had this hack in the libgcc config to build libgcc with
-mcmodel=small for powerpc64 for a long time.  It wouldn't be a bad
thing if someone who knows the multilib machinery well could arrange
for -mcmodel=small to be passed just for ppc64 when building for
earlier than power10.  But for now, make -mno-minimal-toc do nothing
when pcrel.  Which will do the right thing for any project that has
copied libgcc's trick.

We want this if configuring using --with-cpu=power10 to build a
power10 pcrel libgcc.  --mcmodel=small turns off pcrel.

gcc/
	* config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Don't
	set -mcmodel=small for -mno-minimal-toc when pcrel.
libgcc/
	* config/rs6000/t-linux: Document purpose of -mno-minimal-toc.
2020-10-01 10:34:48 +09:30
GCC Administrator 93bca37c0a Daily bump. 2020-09-30 00:16:29 +00:00
Maciej W. Rozycki 090d3f5ab3 RISC-V/libgcc: Use `-fasynchronous-unwind-tables' for LIB2_DIVMOD_FUNCS
Use `-fasynchronous-unwind-tables' rather than `-fexceptions
-fnon-call-exceptions' in LIB2_DIVMOD_FUNCS compilation flags so as to
provide unwind tables for the affected functions while not pulling the
unwinder proper, which is not required here.

Beyond saving program space it fixes a RISC-V glibc build error due to
unsatisfied `malloc' and `free' references from the unwinder causing
link errors with `ld.so' where libgcc has been built at -O0.

	libgcc/
	* config/riscv/t-elf (LIB2_DIVMOD_EXCEPTION_FLAGS): New
	variable.
2020-09-29 01:20:01 +01:00
GCC Administrator e84761c6f3 Daily bump. 2020-09-29 00:16:30 +00:00
Richard Sandiford 1923f615f7 aarch64: Add HF routines to libgcc_s.so
The libgcc HF support routines were being linked into libgcc_s.so,
but weren't being exported.

libgcc/
	* config/aarch64/libgcc-softfp.ver: New file.
	* config/aarch64/t-softfp (SHLIB_MAPFILES): Add it.
2020-09-28 11:26:53 +01:00
GCC Administrator 4383c595ce Daily bump. 2020-09-28 00:16:21 +00:00
Clément Chigot 3c11f25fb8 aix: Use $(AR) without -X32_64 to build FAT libraries.
AIX FAT libraries should be built with the version of AR chosen by configure.
The GNU Make $(AR) variable includes the AIX -X32_64 option needed
by the default Makefile rules to accept both 32 bit and 64 bit object files.
The -X32_64 option conflicts with ar archiving objects of the same name
used to build FAT libraries.

This patch changes the Makefile fragments for AIX FAT libraries to use $(AR),
but strips the -X32_64 option from the Make variable.

libgcc/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/rs6000/t-slibgcc-aix: Use $(AR) without -X32_64.

libatomic/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.

libgomp/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.

libstdc++-v3/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/os/aix/t-aix: Use $(AR) without -X32_64.

libgfortran/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.
2020-09-27 12:43:29 -04:00
GCC Administrator 521d271140 Daily bump. 2020-09-23 00:16:27 +00:00
Sergei Trofimovich 4ecf368f4b 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.
2020-09-22 11:41:04 +01:00
GCC Administrator 2aad20c094 Daily bump. 2020-09-18 00:16:24 +00:00
Christophe Lyon 9fcedcc391 libgcc/config/arm/fp16.c: Make _internal functions static inline
This patch makes the *_internal functions 'static inline' to avoid these warnings during the build:
/libgcc/config/arm/fp16.c:169:1: warning: no previous prototype for '__gnu_h2f_internal' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:194:1: warning: no previous prototype for '__gnu_f2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:200:1: warning: no previous prototype for '__gnu_h2f_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:206:1: warning: no previous prototype for '__gnu_f2h_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:212:1: warning: no previous prototype for '__gnu_h2f_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:218:1: warning: no previous prototype for '__gnu_d2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:224:1: warning: no previous prototype for '__gnu_d2h_alternative' [-Wmissing-prototypes]

2020-09-11  Torbjörn SVENSSON  <torbjorn.svensson@st.com>
	    Christophe Lyon  <christophe.lyon@linaro.org>

	libgcc/
	* config/arm/fp16.c (__gnu_h2f_internal): Add 'static inline'
	qualifier.
	(__gnu_f2h_ieee, __gnu_h2f_ieee, __gnu_f2h_alternative)
	(__gnu_h2f_alternative,__gnu_d2h_ieee, __gnu_d2h_alternative): Add
	missing prototypes.
2020-09-17 12:23:36 +00:00
Wei Wentao ec7ef30421 aarch64: Fixed unused variable warning in aarch64-unwind.h
libgcc/
	* config/aarch64/aarch64-unwind.h (aarch64_demangle_return_addr): Fix
	unused variable warning.
2020-09-17 10:40:23 +01:00
GCC Administrator ecde1b0a46 Daily bump. 2020-09-17 00:16:31 +00:00
Jojo R 03380ecc38 C-SKY: Enable crtbegin/crtend.o of libgcc for elf target
libgcc/ChangeLog:

	* config.host (C-SKY): Enable crtbegin/crtend.o of libgcc for elf target.
2020-09-16 19:34:02 +08:00
GCC Administrator 80f86e78ac Daily bump. 2020-09-10 00:16:28 +00:00
Tom de Vries 7b9c26519e [nvptx, libgcc] Fix Wbuiltin-declaration-mismatch in atomic.c
When building for target nvptx, we get this and similar warnings for libgcc:
...
src/libgcc/config/nvptx/atomic.c:39:1: warning: conflicting types for \
  built-in function ‘__sync_val_compare_and_swap_1’; expected \
  ‘unsigned char(volatile void *, unsigned char,  unsigned char)’ \
  [-Wbuiltin-declaration-mismatch]
...

Fix this by making sure in atomic.c that the pointers used are of type
'volatile void *'.

Tested by rebuilding atomic.c.

libgcc/ChangeLog:

	* config/nvptx/atomic.c (__SYNC_SUBWORD_COMPARE_AND_SWAP): Fix
	Wbuiltin-declaration-mismatch.
2020-09-09 19:22:07 +02:00
GCC Administrator 57ea089421 Daily bump. 2020-08-27 00:16:27 +00:00
Jozef Lawrynowicz 703e049aa7 MSP430: Simplify and extend shift instruction patterns
The implementation of define_expand and define_insn patterns to handle
shifts in the MSP430 backend is inconsistent, resulting in missed
opportunities to make best use of the architecture's features.

There's now a single define_expand used as the entry point for all valid
shifts, and the decision to either use a helper function to perform the
shift (often required for the 430 ISA), or fall through to the
define_insn patterns can be made from that expander function.

Shifts by a constant amount have been grouped into one define_insn for
each type of shift, instead of having different define_insn patterns for
shifts by different amounts.

A new target option "-mmax-inline-shift=" has been added to allow tuning
of the number of shift instructions to emit inline, instead of using
a library helper function.

gcc/ChangeLog:

	* config/msp430/constraints.md (K): Change unused constraint to
	constraint to a const_int between 1 and 19.
	(P): New constraint.
	* config/msp430/msp430-protos.h (msp430x_logical_shift_right): Remove.
	(msp430_expand_shift): New.
	(msp430_output_asm_shift_insns): New.
	* config/msp430/msp430.c (msp430_rtx_costs): Remove shift costs.
	(CSH): Remove.
	(msp430_expand_helper): Remove hard-coded generation of some inline
	shift insns.
	(use_helper_for_const_shift): New.
	(msp430_expand_shift): New.
	(msp430_output_asm_shift_insns): New.
	(msp430_print_operand): Add new 'W' operand selector.
	(msp430x_logical_shift_right): Remove.
	* config/msp430/msp430.md (HPSI): New define_mode_iterator.
	(HDI): Likewise.
	(any_shift): New define_code_iterator.
	(shift_insn): New define_code_attr.
	Adjust unnamed insn patterns searched for by combine.
	(ashlhi3): Remove.
	(slli_1): Remove.
	(430x_shift_left): Remove.
	(slll_1): Remove.
	(slll_2): Remove.
	(ashlsi3): Remove.
	(ashldi3): Remove.
	(ashrhi3): Remove.
	(srai_1): Remove.
	(430x_arithmetic_shift_right): Remove.
	(srap_1): Remove.
	(srap_2): Remove.
	(sral_1): Remove.
	(sral_2): Remove.
	(ashrsi3): Remove.
	(ashrdi3): Remove.
	(lshrhi3): Remove.
	(srli_1): Remove.
	(430x_logical_shift_right): Remove.
	(srlp_1): Remove.
	(srll_1): Remove.
	(srll_2x): Remove.
	(lshrsi3): Remove.
	(lshrdi3): Remove.
	(<shift_insn><mode>3): New define_expand.
	(<shift_insn>hi3_430): New define_insn.
	(<shift_insn>si3_const): Likewise.
	(ashl<mode>3_430x): Likewise.
	(ashr<mode>3_430x): Likewise.
	(lshr<mode>3_430x): Likewise.
	(*bitbranch<mode>4_z): Replace renamed predicate msp430_bitpos with
	const_0_to_15_operand.
	* config/msp430/msp430.opt: New option -mmax-inline-shift=.
	* config/msp430/predicates.md (const_1_to_8_operand): New predicate.
	(const_0_to_15_operand): Rename msp430_bitpos predicate.
	(const_1_to_19_operand): New predicate.
	* doc/invoke.texi: Document -mmax-inline-shift=.

libgcc/ChangeLog:

	* config/msp430/slli.S (__gnu_mspabi_sllp): New.
	* config/msp430/srai.S (__gnu_mspabi_srap): New.
	* config/msp430/srli.S (__gnu_mspabi_srlp): New.

gcc/testsuite/ChangeLog:

	* gcc.target/msp430/emulate-srli.c: Fix expected assembler text.
	* gcc.target/msp430/max-inline-shift-430-no-opt.c: New test.
	* gcc.target/msp430/max-inline-shift-430.c: New test.
	* gcc.target/msp430/max-inline-shift-430x.c: New test.
2020-08-26 20:50:58 +01:00
GCC Administrator b3cb56060b Daily bump. 2020-08-14 00:16:24 +00:00
Kwok Cheung Yeung 17dc08edc2 nvptx: Add support for subword compare-and-swap
This adds support for __sync_val_compare_and_swap and
__sync_bool_compare_and_swap for 1-byte and 2-byte long
values, which are not natively supported on nvptx.

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

2020-07-16  Kwok Cheung Yeung  <kcy@codesourcery.com>

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

	gcc/testsuite/
	* gcc.target/nvptx/ia64-sync-5.c: New.

	libgomp/
	* testsuite/libgomp.c-c++-common/reduction-16.c: New.
2020-08-13 11:11:55 +02:00
GCC Administrator 6a1ad710ad Daily bump. 2020-08-04 00:16:24 +00:00
Ian Lance Taylor 2b6a53238f libgcc: increase required stack space for x86_64 -fsplit-stack
This accomodates increased space required by use of the xsavec
instruction in the dynamic linker trampoline.

libgcc/ChangeLog:

	* config/i386/morestack.S (BACKOFF) [x86_64]: Add 2048 bytes.
2020-08-03 16:01:59 -07:00
Jakub Jelinek 90b43856fd 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.
2020-08-03 22:55:28 +02:00
GCC Administrator 48cc2e468c Daily bump. 2020-08-01 00:16:25 +00:00
Maciej W. Rozycki 9fa4023c7a RISC-V/libgcc: Reduce the size of RV64 millicode by 6 bytes
Rewrite code sequences throughout the 64-bit RISC-V `__riscv_save_*'
routines replacing `li t1, -48', `li t1, -64', and `li t1, -80',
instructions, which do not have a compressed encoding, respectively with
`li t1, 3', `li t1, 4', and `li t1, 4', which do, and then adjusting the
remaining code accordingly observing that `sub sp, sp, t1' takes the
same amount of space as an `slli t1, t1, 4'/`add sp, sp, t1' instruction
pair does, again due to the use of compressed encodings, saving 6 bytes
total.

This change does increase code size by 4 bytes for RISC-V processors
lacking the compressed instruction set, however their users couldn't
care about the code size or they would have chosen an implementation
that does have the compressed instructions, wouldn't they?

	libgcc/
	* config/riscv/save-restore.S [__riscv_xlen == 64]
	(__riscv_save_10, __riscv_save_8, __riscv_save_6, __riscv_save_4)
	(__riscv_save_2): Replace negative immediates used for the final
	stack pointer adjustment with positive ones, right-shifted by 4.
2020-07-31 23:52:20 +01:00
Martin Liska bc2b1a232b libgcov: support overloaded malloc
gcc/ChangeLog:

	* gcov-io.h (GCOV_PREALLOCATED_KVP): New.

libgcc/ChangeLog:

	* libgcov-driver.c: Add __gcov_kvp_pool
	and __gcov_kvp_pool_index variables.
	* libgcov.h (allocate_gcov_kvp): New.
	(gcov_topn_add_value): Use it.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-prof/indir-call-prof-malloc.c: New test.
2020-07-31 10:57:50 +02:00
GCC Administrator 53256ee3d5 Daily bump. 2020-07-25 00:16:22 +00:00
Szabolcs Nagy edfb3a30a6 aarch64: add PAC GNU property note to libgcc lse.S
This note is not used anywhere currently but it is supposed to mark
objects if the return address is protected with PAC on the stack.
Since lse.S only has leaf functions the return address is never
saved on the stack so we can add the note.

The note is only added if pac-ret is enabled because it can cause
problems with old linkers and we don't have checks for that. This
can be changed later to be unconditional, for now it is consistent
with how gcc generates the notes.

libgcc/ChangeLog:

	* config/aarch64/lse.S: Add PAC property note.
2020-07-24 11:44:43 +01:00
GCC Administrator 9bb403dca6 Daily bump. 2020-07-24 00:16:20 +00:00
Martin Liska 24c35a5ef3
gcov: create folders with 0777.
libgcc/ChangeLog:

	PR gcov-profile/96035
	* libgcov-driver-system.c: Create gcov folders with 0777
	so that it respects a system umask.
2020-07-23 12:20:40 +02:00
GCC Administrator 8ca07a3072 Daily bump. 2020-07-15 00:16:35 +00:00
David Edelsohn 4f97bed9a7 aix: FAT libraries: test native compiler mode directly
The FAT libraries config fragments need to know which library is native
and which is a multilib to choose the correct multilib from which to
append the additional object file or shared object file.  Testing the
top-level archive is fragile because it will fail if rebuilding.  This
patch tests the compiler preprocessing macros for the 64 bit AIX specific
__64BIT__ to determine the native mode of the compiler in MULTILIBTOP.

2020-07-14  David Edelsohn  <dje.gcc@gmail.com>

libatomic/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgcc/ChangeLog

	* config/rs6000/t-slibgcc-aix: Set BITS from compiler cpp macro.

libgfortran/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgomp/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libstdc++-v3/ChangeLog

	* config/os/aix/t-aix: Set BITS from compiler cpp macro.
2020-07-14 10:41:40 -04:00
GCC Administrator ea69fcf9a0 Daily bump. 2020-07-14 00:16:30 +00:00
Szabolcs Nagy b097c7a27f 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.
2020-07-13 13:49:20 +01:00
GCC Administrator 3f8ca9cb86 Daily bump. 2020-07-10 00:16:28 +00:00
Szabolcs Nagy f0f62fa032 aarch64: Fix BTI support in libgcc [PR96001]
lse.S did not have the GNU property note markup and the BTI c
instructions that are necessary when it is built with branch
protection.

The notes are only added when libgcc is built with branch
protection, because old linkers mishandle the note (merge
them incorrectly or emit warnings), the BTI instructions
are added unconditionally.

Note: BTI c is only necessary at function entry if the function
may be called indirectly, currently lse functions are not called
indirectly, but BTI is added for ABI reasons e.g. to allow
linkers later to emit stub code with indirect jump.

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

libgcc/ChangeLog:

	PR target/96001
	* config/aarch64/lse.S: Add BTI marking and related definitions,
	and add BTI c to function entries.
2020-07-09 09:50:25 +01:00
Szabolcs Nagy e73ec75548 aarch64: Fix noexecstack note in libgcc
lse.S did not have GNU stack note, this may cause missing
PT_GNU_STACK in binaries on Linux and FreeBSD.

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

libgcc/ChangeLog:

	* config/aarch64/lse.S: Add stack note.
2020-07-09 09:50:25 +01:00
GCC Administrator b5f2473963 Daily bump. 2020-07-03 00:16:25 +00:00
Martin Liska ece21ff6ea
Do not stream all zeros for gcda files.
gcc/ChangeLog:

	PR gcov-profile/95348
	* coverage.c (read_counts_file): Read only COUNTERS that are
	not all-zero.
	* gcov-dump.c (tag_function): Change signature from unsigned to
	signed integer.
	(tag_blocks): Likewise.
	(tag_arcs): Likewise.
	(tag_lines): Likewise.
	(tag_counters): Likewise.
	(tag_summary): Likewise.
	* gcov.c (read_count_file): Read all non-zero counters
	sensitively.

libgcc/ChangeLog:

	PR gcov-profile/95348
	* libgcov-driver.c (merge_one_data): Merge only profiles
	that are not of non-zero type.
	(write_one_data): Write counters only if there's one non-zero
	value.
	* libgcov-util.c (tag_function): Change signature from unsigned
	to int.
	(tag_blocks): Likewise.
	(tag_arcs): Likewise.
	(tag_counters): Likewise.
	(tag_summary): Likewise.
	(tag_lines): Read only if COUNTERS is non-zero.
	(read_gcda_file): Handle negative length for COUNTERS type.
2020-07-02 10:16:02 +02:00
GCC Administrator d61ffe1244 Daily bump. 2020-06-26 00:16:23 +00:00
Martin Liska 88891c5ff0
gcov-tool: fix merge operation for summary
libgcc/ChangeLog:

	* libgcov-driver.c (merge_summary): Remove function as its name
	is misleading and doing something different.
	(dump_one_gcov): Add ATTRIBUTE_UNUSED for 2 args. Take read summary
	in gcov-tool.
	* libgcov-util.c (curr_object_summary): Remove.
	(read_gcda_file): Remove unused curr_object_summary.
	(gcov_merge): Merge summaries.
	* libgcov.h: Add summary argument for gcov_info struct.
2020-06-25 11:27:12 +02:00
GCC Administrator 2e546c261b Daily bump. 2020-06-25 00:16:30 +00:00
David Edelsohn acba4660b4 Fix typo in ChangeLog 2020-06-24 10:10:56 -04:00
H.J. Lu 1890f2f0e2 x86: Move cpuinfo.h from libgcc to common/config/i386
Both x86 backend and libgcc define enum processor_features.  libgcc sets
enum processor_feature and x86 backend checks enum processor_feature.
They are very easy out of sync and it has happened multiple times in the
past.

1. Move cpuinfo.h from libgcc to common/config/i386 so that we can share
the same enum processor_features in x86 backend and libgcc.
2. Change __cpu_features2 to an array to support more processor features.
3. Add more processor features to enum processor_features.

gcc/

	PR target/95259
	* common/config/i386/cpuinfo.h: New file.
	(__processor_model): Moved from libgcc/config/i386/cpuinfo.h.
	(__processor_model2): New.
	(CHECK___builtin_cpu_is): New.  Defined as empty if not defined.
	(has_cpu_feature): New function.
	(set_cpu_feature): Likewise.
	(get_amd_cpu): Moved from libgcc/config/i386/cpuinfo.c.  Use
	CHECK___builtin_cpu_is.  Return AMD CPU name.
	(get_intel_cpu): Moved from libgcc/config/i386/cpuinfo.c.  Use
	Use CHECK___builtin_cpu_is.  Return Intel CPU name.
	(get_available_features): Moved from libgcc/config/i386/cpuinfo.c.
	Also check FEATURE_3DNOW, FEATURE_3DNOWP, FEATURE_ADX,
	FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT, FEATURE_CLWB,
	FEATURE_CLZERO, FEATURE_CMPXCHG16B, FEATURE_CMPXCHG8B,
	FEATURE_ENQCMD, FEATURE_F16C, FEATURE_FSGSBASE, FEATURE_FXSAVE,
	FEATURE_HLE, FEATURE_IBT, FEATURE_LAHF_LM, FEATURE_LM,
	FEATURE_LWP, FEATURE_LZCNT, FEATURE_MOVBE, FEATURE_MOVDIR64B,
	FEATURE_MOVDIRI, FEATURE_MWAITX, FEATURE_OSXSAVE,
	FEATURE_PCONFIG, FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW,
	FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED,
	FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA,
	FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES,
	FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC,
	FEATURE_XSAVEOPT and FEATURE_XSAVES
	(cpu_indicator_init): Moved from libgcc/config/i386/cpuinfo.c.
	Also update cpu_model2.
	* common/config/i386/i386-cpuinfo.h (processor_vendor): Add
	Add VENDOR_CENTAUR, VENDOR_CYRIX and VENDOR_NSC.
	(processor_features): Moved from gcc/config/i386/i386-builtins.c.
	Renamed F_XXX to FEATURE_XXX.  Add FEATURE_3DNOW, FEATURE_3DNOWP,
	FEATURE_ADX, FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT,
	FEATURE_CLWB, FEATURE_CLZERO, FEATURE_CMPXCHG16B,
	FEATURE_CMPXCHG8B, FEATURE_ENQCMD, FEATURE_F16C,
	FEATURE_FSGSBASE, FEATURE_FXSAVE, FEATURE_HLE, FEATURE_IBT,
	FEATURE_LAHF_LM, FEATURE_LM, FEATURE_LWP, FEATURE_LZCNT,
	FEATURE_MOVBE, FEATURE_MOVDIR64B, FEATURE_MOVDIRI,
	FEATURE_MWAITX, FEATURE_OSXSAVE, FEATURE_PCONFIG,
	FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW,
	FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED,
	FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA,
	FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES,
	FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC,
	FEATURE_XSAVEOPT, FEATURE_XSAVES and CPU_FEATURE_MAX.
	(SIZE_OF_CPU_FEATURES): New.
	* config/i386/i386-builtins.c (processor_features): Removed.
	(isa_names_table): Replace F_XXX with FEATURE_XXX.
	(fold_builtin_cpu): Change __cpu_features2 to an array.

libgcc/

	PR target/95259
	* config/i386/cpuinfo.c: Don't include "cpuinfo.h".  Include
	"common/config/i386/i386-cpuinfo.h" and
	"common/config/i386/cpuinfo.h".
	(__cpu_features2): Changed to array.
	(get_amd_cpu): Removed.
	(get_intel_cpu): Likewise.
	(get_available_features): Likewise.
	(__cpu_indicator_init): Call cpu_indicator_init.
	* config/i386/cpuinfo.h: Removed.
2020-06-24 05:47:34 -07:00
GCC Administrator 4543acc874 Daily bump. 2020-06-24 00:16:31 +00:00
David Edelsohn 17964eb3a0 build: Change conditional include and empty.mk to -include in Makefiles
GNU Make supports "-include" keyword to prevent warnings and errors due to
inclusion of non-existent files.  This patch changes gcc/ and libgcc/ to use
"-include" in place of the historical conditional inclusion and use of
empty.mk work-arounds.

gcc/ChangeLog

2020-06-23  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.in (LANG_MAKEFRAGS): Same.
	(tmake_file): Use -include.
	(xmake_file): Same.

libgcc/ChangeLog

2020-06-23  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.in: Remove uses of empty.mk. Use -include.
	* config/avr/t-avr: Use -include.
	* empty.mk: Delete.

libgcc/config/avr/libf7/ChangeLog

2020-06-23  David Edelsohn  <dje.gcc@gmail.com>

	* t-libf7: Same.
2020-06-23 17:28:09 +00:00
GCC Administrator f86e11a267 Daily bump. 2020-06-22 00:16:23 +00:00
David Edelsohn 47ddb895df aix: Add GCC64 configuration and FAT target libraries.
This patch adds the ability to configure GCC on AIX to build as a
64 bit application and to build target libraries "FAT" libraries in both
32 bit and 64 bit mode.

The patch adds makefile fragment hooks to target libraries that allows
them to include target-specific rules.  The target specific rules for
AIX place both 32 bit and 64 bit objects and shared objects
in archives at the top-level, not multilib subdirectories.  The
multilibs are built in subdirectories, but must be combined during the
last parts of the target library build process.  Because of the way
that GCC bootstrap works, the libraries must be combined during the
multiple stages of GCC bootstrap, not solely when installed in the
final destination, so the libraries are correct at the end of
each target library build stage, not solely an install recipe.

gcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.gcc: Use t-aix64, biarch64 and default64 for cpu_is_64bit.
	* config/rs6000/aix72.h (ASM_SPEC): Remove aix64 option.
	(ASM_SPEC32): New.
	(ASM_SPEC64): New.
	(ASM_CPU_SPEC): Remove vsx and altivec options.
	(CPP_SPEC_COMMON): Rename from CPP_SPEC.
	(CPP_SPEC32): New.
	(CPP_SPEC64): New.
	(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
	(TARGET_DEFAULT): Only define if not BIARCH.
	(LIB_SPEC_COMMON): Rename from LIB_SPEC.
	(LIB_SPEC32): New.
	(LIB_SPEC64): New.
	(LINK_SPEC_COMMON): Rename from LINK_SPEC.
	(LINK_SPEC32): New.
	(LINK_SPEC64): New.
	(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
	(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
	(CPP_SPEC): Same.
	(CPLUSPLUS_CPP_SPEC): Same.
	(LIB_SPEC): Same.
	(LINK_SPEC): Same.
	(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
	* config/rs6000/defaultaix64.h: New file.
	* config/rs6000/t-aix64: New file.

libgcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.host (extra_parts): Add crtcxa_64 and crtdbase_64.
	* config/rs6000/t-aix-cxa: Explicitly compile 32 bit with -maix32
	and 64 bit with -maix64.
	* config/rs6000/t-slibgcc-aix: Remove extra @multilib_dir@ level.
	Build and install AIX-style FAT libraries.

libgomp/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libstdc++-v3/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host (aix*): Define tmake_file.
	* config/os/aix/t-aix: New file.

libatomic/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libgfortran/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host: Add system configury stanza. Define tmake_file.
	* config/t-aix: New file.
2020-06-21 14:14:46 -04:00
GCC Administrator aff95ee7cc Daily bump. 2020-06-18 00:16:37 +00:00
Samuel Thibault 5e2eebc80d hurd: libgcc unwinding support over signal trampolines
libgcc/
	* config.host (md_unwind_header) <i[34567]86-*-gnu*>: Set to
	'i386/gnu-unwind.h'
	* config/i386/gnu-unwind.h: New file.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2020-06-18 00:01:27 +02:00
Martin Liska 5fc312a98e
gcov: fix gcov-tool merge for TOPN counters
libgcc/ChangeLog:

	* libgcov-util.c (read_gcda_finalize): Remove const operator.
	(merge_wrapper): Add both counts and use them properly.
	(topn_to_memory_representation): New function.
	(gcov_merge): Covert on disk representation to in memory
	representation.
	* libgcov.h: Remove const operator.
2020-06-17 08:32:27 +02:00
GCC Administrator 6fb94d67f1 Daily bump. 2020-06-16 00:16:28 +00:00
Max Filippov 8c8eb94914 gcc: xtensa: add -mabi option for call0/windowed ABI
2020-06-15  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/elf.h (ASM_SPEC, LINK_SPEC): Pass ABI switch to
	assembler/linker.
	* config/xtensa/linux.h (ASM_SPEC, LINK_SPEC): Ditto.
	* config/xtensa/uclinux.h (ASM_SPEC, LINK_SPEC): Ditto.
	* config/xtensa/xtensa.c (xtensa_option_override): Initialize
	xtensa_windowed_abi if needed.
	* config/xtensa/xtensa.h (TARGET_WINDOWED_ABI_DEFAULT): New
	macro.
	(TARGET_WINDOWED_ABI): Redefine to xtensa_windowed_abi.
	* config/xtensa/xtensa.opt (xtensa_windowed_abi): New target
	option variable.
	(mabi=call0, mabi=windowed): New options.
	* doc/invoke.texi: Document new -mabi= Xtensa-specific options.

gcc/testsuite/
	* gcc.target/xtensa/mabi-call0.c: New test.
	* gcc.target/xtensa/mabi-windowed.c: New test.

libgcc/
	* configure: Regenerate.
	* configure.ac: Use AC_COMPILE_IFELSE instead of manual
	preprocessor invocation to check for __XTENSA_CALL0_ABI__.
2020-06-15 03:35:50 -07:00
GCC Administrator b952c2cfcd Daily bump. 2020-06-10 00:16:47 +00:00
Martin Liska 862b9b225f
libgcov: fix TOPN type casting
The patch fixes tree-prof.exp tests on solaris11 and i686-linux-gnu,
problem was that sizeof of a pointer is different from sizeof gcov_type.

I'm going to install it if there are no objections.
Thanks,
Martin

libgcc/ChangeLog:

	PR gcov-profile/95494
	* libgcov-driver.c (write_top_counters): Cast first to
	intptr_t as sizeof(*) != sizeof(gcov_type).
	* libgcov.h (gcov_counter_set_if_null): Remove.
	(gcov_topn_add_value): Cast first to intptr_t and update
	linked list directly.
2020-06-09 13:07:41 +02:00
Max Filippov 1d9921cbdc xtensa: libgcc: fix PR target/95571
Rewrite uw_install_context without function calls to avoid register
spilling in _Unwind_RaiseException during return context installation.

2020-06-08  Max Filippov  <jcmvbkbc@gmail.com>
gcc/testsuite/
	* g++.target/xtensa/pr95571.C: New test.
	* g++.target/xtensa/xtensa.exp: New testsuite.

libgcc/
	* config/xtensa/unwind-dw2-xtensa.c (uw_install_context): Merge
	with uw_install_context_1.
2020-06-08 18:30:07 -07:00
GCC Administrator 3add342502 Daily bump. 2020-06-05 00:16:30 +00:00
Andreas Schwab 0ecf522972 Missing __divtf3@@GCC_4.4.0 on ia64
gcc/testsuite/
	PR libfortran/59227
	* gfortran.dg/erf_3.F90: Remove XFAIL on ia64-*-linux*.

libgcc/
	PR target/59230
	PR libfortran/59227
	* config/ia64/t-softfp-compat (softfp_file_list): Filter out
	soft-fp/divtf3.c.
	(LIB2ADD): Add config/ia64/divtf3.c.
	* config/ia64/divtf3.c: New file.
2020-06-04 09:56:32 +02:00
GCC Administrator 9a5b7438c8 Daily bump. 2020-06-04 00:16:34 +00:00
Martin Liska eb3480fc0f
gcov: Fix build on AIX
We must guard used atomic builtins with GCOV_SUPPORTS_ATOMIC.
The patch is tested on AIX and I'm going to push it.

libgcc/ChangeLog:

	PR gcov-profile/95480
	* libgcov-profiler.c (GCOV_SUPPORTS_ATOMIC): Move to...
	* libgcov.h (GCOV_SUPPORTS_ATOMIC): ...here.
	(gcov_counter_add): Use GCOV_SUPPORTS_ATOMIC guard.
	(gcov_counter_set_if_null): Likewise.
2020-06-03 08:12:50 +02:00
GCC Administrator a9312a7926 Daily bump. 2020-06-03 00:16:34 +00:00
Jim Wilson 4013baf99c 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.
2020-06-02 11:44:44 -07:00
Martin Liska a04b7410d3
libgcov: replace malloc and calloc.
The calloc was in the original tested version of the patch
and I made accidental last minute change.

Installed to master as obvious.

libgcc/ChangeLog:

	* libgcov.h (gcov_topn_add_value): Use xcalloc instead
	of xmalloc.
2020-06-02 13:57:31 +02:00
Martin Liska 871e5ada6d
Make TOPN counter dynamically allocated.
gcc/ChangeLog:

	* coverage.c (get_coverage_counts): Skip sanity check for TOP N counters
	as they have variable number of counters.
	* gcov-dump.c (main): Add new option -r.
	(print_usage): Likewise.
	(tag_counters): All new raw format.
	* gcov-io.h (struct gcov_kvp): New.
	(GCOV_TOPN_VALUES): Remove.
	(GCOV_TOPN_VALUES_COUNTERS): Likewise.
	(GCOV_TOPN_MEM_COUNTERS): New.
	(GCOV_TOPN_DISK_COUNTERS): Likewise.
	(GCOV_TOPN_MAXIMUM_TRACKED_VALUES): Likewise.
	* ipa-profile.c (ipa_profile_generate_summary): Use
	GCOV_TOPN_MAXIMUM_TRACKED_VALUES.
	(ipa_profile_write_edge_summary): Likewise.
	(ipa_profile_read_edge_summary): Likewise.
	(ipa_profile): Remove usage of GCOV_TOPN_VALUES.
	* profile.c (sort_hist_values): Sort variable number
	of counters.
	(compute_value_histograms): Special case for TOP N counters
	that have dynamic number of key-value pairs.
	* value-prof.c (dump_histogram_value): Dump variable number
	of key-value pairs.
	(stream_in_histogram_value): Stream in variable number
	of key-value pairs for TOP N counter.
	(get_nth_most_common_value): Deal with variable number
	of key-value pairs.
	(dump_ic_profile): Use GCOV_TOPN_MAXIMUM_TRACKED_VALUES
	for loop iteration.
	(gimple_find_values_to_profile): Set GCOV_TOPN_MEM_COUNTERS
	to n_counters.
	* doc/gcov-dump.texi: Document new -r option.

libgcc/ChangeLog:

	* libgcov-driver.c (prune_topn_counter): Remove.
	(prune_counters): Likewise.
	(merge_one_data): Special case TOP N counters
	as they have variable length.
	(write_top_counters): New.
	(write_one_data): Special case TOP N.
	(dump_one_gcov): Do not prune TOP N counters.
	* libgcov-merge.c (merge_topn_values_set): Remove.
	(__gcov_merge_topn): Use gcov_topn_add_value.
	* libgcov-profiler.c (__gcov_topn_values_profiler_body):
	Likewise here.
	* libgcov.h (gcov_counter_add): New.
	(gcov_counter_set_if_null): Likewise.
	(gcov_topn_add_value): New.
2020-06-02 12:11:02 +02:00
GCC Administrator 4a9aa9dec7 Daily bump. 2020-06-02 00:16:25 +00:00
Uros Bizjak 832c1192eb i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418]
Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved.
The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order
to match the layout of x87 state image in memory.

2020-06-01  Uroš Bizjak  <ubizjak@gmail.com>

libatomic/ChangeLog:
	* config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)).

libgcc/ChangeLog:
	* config/i386/sfp-exceptions.c (struct fenv):
	Add __attribute__ ((gcc_struct)).

libgfortran/ChangeLog:
	PR libfortran/95418
	* config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)).
2020-06-01 22:29:20 +02:00
GCC Administrator 885ef72f27 Daily bump. 2020-05-30 00:16:27 +00:00
H.J. Lu 9051b54827 Avoid nested save_CFLAGS and save_LDFLAGS
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and
save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4.

config/

	PR bootstrap/95413
	* cet.m4: Replace save_CFLAGS and save_LDFLAGS with
	cet_save_CFLAGS and cet_save_LDFLAGS.

gcc/

	PR bootstrap/95413
	* configure: Regenerated.

libatomic/

	PR bootstrap/95413
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95413
	* configure: Regenerated.

libcc1/

	PR bootstrap/95413
	* configure: Regenerated.

libcpp/

	PR bootstrap/95413
	* configure: Regenerated.

libdecnumber/

	PR bootstrap/95413
	* configure: Regenerated.

libgcc/

	PR bootstrap/95413
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95413
	* configure: Regenerated.

libgomp/

	PR bootstrap/95413
	* configure: Regenerated.

libiberty/

	PR bootstrap/95413
	* configure: Regenerated.

libitm/

	PR bootstrap/95413
	* configure: Regenerated.

libobjc/

	PR bootstrap/95413
	* configure: Regenerated.

libphobos/

	PR bootstrap/95413
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95413
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95413
	* configure: Regenerated.

libssp/

	PR bootstrap/95413
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95413
	* configure: Regenerated.

libvtv/

	PR bootstrap/95413
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/95413
	* configure: Regenerated.

zlib/

	PR bootstrap/95413
	* configure: Regenerated.
2020-05-29 12:56:40 -07:00
GCC Administrator 53ffb43a79 Daily bump. 2020-05-29 00:16:23 +00:00
Martin Liska 17d1594bfe
gcov-tool: Flexible endian adjustment for merging coverage data
gcc/ChangeLog:
2020-05-27  Dong JianQiang  <dongjianqiang2@huawei.com>

	PR gcov-profile/95332
	* gcov-io.c (gcov_var::endian): Move field.
	(from_file): Add IN_GCOV_TOOL check.
	* gcov-io.h (gcov_magic): Ditto.

libgcc/ChangeLog:
2020-05-27  Dong JianQiang  <dongjianqiang2@huawei.com>

	PR gcov-profile/95332
	* libgcov-util.c (read_gcda_file): Call gcov_magic.
	* libgcov.h (gcov_magic): Disable GCC poison.
2020-05-28 08:18:21 +02:00
H.J. Lu 5855bdfa06 libgcc: Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16
Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16 to avoid
changing libgcc ABI.

gcc/

	PR target/95212
	* config/i386/i386-builtins.c (processor_features): Move
	F_AVX512VP2INTERSECT after F_AVX512BF16.
	(isa_names_table): Likewise.

libgcc/

	PR target/95212
	* config/i386/cpuinfo.h (processor_features): Move
	FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16.
2020-05-21 05:33:11 -07:00
H.J. Lu 35b980365c Add missing ChangeLog entry for r11-516 2020-05-20 04:23:38 -07:00
H.J. Lu 1e46a443f2 x86: Update VPCLMULQDQ check
Update VPCLMULQDQ check to support processors with AVX version of
VPCLMULQDQ.

	PR target/91695
	* config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ
	check.
2020-05-20 04:12:58 -07:00
H.J. Lu 453954451b x86: Add FEATURE_AVX512VP2INTERSECT and update GFNI check
Add FEATURE_AVX512VP2INTERSECT to libgcc so that enum processor_features
in libgcc matches enum processor_features in i386-builtins.c.  Update
GFNI check to support processors with SSE and AVX versions of GFNI.

	PR target/95212
	PR target/95220
	* config/i386/cpuinfo.c (get_available_features): Fix
	FEATURE_GFNI check.  Also check FEATURE_AVX512VP2INTERSECT.
	* config/i386/cpuinfo.h (processor_features): Add
	FEATURE_AVX512VP2INTERSECT.
2020-05-19 14:42:22 -07:00
H.J. Lu 4c1a5d8b71 x86: Also check if -fcf-protection works
When defaulting CET run-time support to auto, check if -fcf-protection
works.  Even if the stage1 GCC doesn't support -fcf-protection, since
the final GCC does, CET run-time support will be enabled by default if
binutils support CET.

config/

	PR bootstrap/95147
	* cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works
	when defaulting to auto.

libatomic/

	PR bootstrap/95147
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95147
	* configure: Regenerated.

libgcc/

	PR bootstrap/95147
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95147
	* configure: Regenerated.

libgomp/

	PR bootstrap/95147
	* configure: Regenerated.

libitm/

	PR bootstrap/95147
	* configure: Regenerated.

libobjc/

	PR bootstrap/95147
	* configure: Regenerated.

libphobos/

	PR bootstrap/95147
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95147
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95147
	* configure: Regenerated.

libssp/

	PR bootstrap/95147
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95147
	* configure: Regenerated.

libvtv/

	PR bootstrap/95147
	* configure: Regenerated.

zlib/

	PR bootstrap/95147
	* configure: Regenerated.
2020-05-15 09:07:17 -07:00
H.J. Lu 8d286dd118 x86: Default CET run-time support to auto
CET has been added since GCC 8.  This patch defaults CET run-time support
to auto.  It enables CET run-time support if asssembler supports CET
instructions and multi-byte NOPs are enabled via SSE2.

config/

	* cet.m4 (GCC_CET_FLAGS): Change default to auto.

gcc/

	* configure: Regenerated.

libatomic/

	* configure: Regenerated.

libbacktrace/

	* configure: Regenerated.

libcc1/

	* configure: Regenerated.

libcpp/

	* configure: Regenerated.

libdecnumber/

	* configure: Regenerated.

libgcc/

	* configure: Regenerated.

libgfortran/

	* configure: Regenerated.

libgomp/

	* configure: Regenerated.

libitm/

	* configure: Regenerated.

libobjc/

	* configure: Regenerated.

libquadmath/

	* configure: Regenerated.

libsanitizer/

	* configure: Regenerated.

libssp/

	* configure: Regenerated.

libstdc++-v3/

	* configure: Regenerated.

libvtv/

	* configure: Regenerated.

zlib/

	* configure: Regenerated.
2020-05-14 09:05:02 -07:00
Hans-Peter Nilsson 39748a8997 libgcc: cris: Remove support for crisv32-*-* and cris*-*-linux
Part of the removal of crisv32-* and cris-*-linux* (cris-elf remains).

libgcc:
	* config.host: Remove support for crisv32-*-* and cris*-*-linux.
	* config/cris/libgcc-glibc.ver, config/cris/t-linux: Remove.
2020-05-09 03:00:38 +02:00
Uros Bizjak d3a1459cd4 i386: Use generic division to generate INEXACT exception
Introduce math_force_eval_div to use generic division to generate
INEXACT as well as INVALID and DIVZERO exceptions.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(__sfp_handle_exceptions): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.

libatomic/ChangeLog:

	* config/x86/fenv.c (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(__atomic_deraiseexcept): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.

libgfortran/ChangeLog:

	* config/fpu-387.h (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(local_feraiseexcept): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.
	(struct fenv): Define named struct instead of typedef.
2020-05-06 23:01:32 +02:00
Kyrylo Tkachov 1266778548 [AArch64] Use __getauxval instead of getauxval in LSE detection code in libgcc
This version of the fix uses __getauxval instead of getauxval.
The whole thing is guarded simply on __gnu_linux__.
__getauxval was introduced in 2.16 but the aarch64 port was added in 2.17 so in practice I expect all aarch64 glibcs to support __getauxval.

Bootstrapped and tested on aarch64-none-linux-gnu.
Also tested on aarch64-none-elf.

2020-05-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/aarch64/lse-init.c (init_have_lse_atomics): Use __getauxval
	instead of getauxval.
	(AT_HWCAP): Define.
	(HWCAP_ATOMICS): Define.
	Guard detection on __gnu_linux__.
2020-05-06 16:20:38 +01:00
Michael Meissner e5185cc6be Delete file meant for a private branch 2020-05-05 14:08:33 -04:00
Michael Meissner 35a4fe9dcf Delete file meant for private branch 2020-05-05 14:07:02 -04:00
Michael Meissner d236b30c5c Remove files meant for private branch 2020-05-05 14:04:59 -04:00
Michael Meissner ef836167f5 Delete changes meant for a private branch.
2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-builtin.def: Delete changes meant for a
	private branch.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000-call.c: Likewise.
	* gcc/config/rs6000/rs6000.c: Likewise.

2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* gcc.dg/nextafter-2.c: Delete changes meant for a private branch.
	* gcc.target/powerpc/pr70117.c: Likewise.

2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* config.host: Delete changes meant for a private branch.
	* config/rs6000/t-float128: Likewise.
	* configure.ac: Likewise.
	* configure: Likewise.
2020-05-05 14:03:30 -04:00
Michael Meissner 3338afa4a3 Patch ieee128-lib-patch010b 2020-05-05 14:03:30 -04:00
Michael Meissner 03831dcc98 New file 2020-05-05 14:03:30 -04:00
Michael Meissner 8e01d9d790 New files 2020-05-05 14:03:29 -04:00
Michael Meissner 931ab4fd33 Update ChangeLog 2020-05-05 13:36:17 -04:00
Michael Meissner 63f3d98b69 Remove extra newline 2020-05-05 13:35:40 -04:00
Michael Meissner 6034b9ca24 Patch ieee128-lib-patch003b 2020-05-05 13:31:03 -04:00
Michael Meissner 438085cc66 setup branch 2020-05-05 12:24:18 -04:00
Martin Liska 811b7636cb
Remove __gcov_flush.
PR gcov-profile/93623
	* tree-cfg.c (stmt_can_terminate_bb_p): Update comment to reflect
	reality.
	PR gcov-profile/93623
	* Makefile.in: Remove __gcov_flush.
	* gcov.h (__gcov_flush): Remove.
	* libgcov-interface.c (__gcov_flush): Remove.
	(init_mx): Use renamed mutex.
	(__gcov_lock): Likewise.
	(__gcov_unlock): Likewise.
	(__gcov_fork): Likewise.
	(__gcov_flush): Remove.
2020-05-05 16:15:47 +02:00
Martin Liska c0532db47d
Use __gcov_dump and __gcov_reset in execv and fork context.
PR gcov-profile/93623
	* libgcov-interface.c (__gcov_fork): Do not flush
	and reset only in child process.
	(__gcov_execl): Dump counters only and reset them
	only if exec* fails.
	(__gcov_execlp): Likewise.
	(__gcov_execle): Likewise.
	(__gcov_execv): Likewise.
	(__gcov_execvp): Likewise.
	(__gcov_execve): Likewise.
2020-05-05 16:15:46 +02:00
Martin Liska d39f7dc8d5
Do locking for __gcov_dump and __gcov_reset as well.
PR gcov-profile/93623
	* Makefile.in: Add _gcov_lock_unlock to LIBGCOV_INTERFACE.
	* libgcov-interface.c (ALIAS_void_fn): Remove.
	(__gcov_lock): New.
	(__gcov_unlock): New.
	(__gcov_flush): Use __gcov_lock and __gcov_unlock.
	(__gcov_reset): Likewise.
	(__gcov_dump): Likewise.
	* libgcov.h (__gcov_lock): New declaration.
	(__gcov_unlock): Likewise.
2020-05-05 16:15:45 +02:00
Martin Liska af2311abf8
Add missing ChangeLog entries. 2020-05-05 16:10:13 +02:00
Martin Liska 8b33430b53
Remove 2 dead variables in bid_internal.h.
libgcc/config/libbid/ChangeLog:

2020-02-04  Martin Liska  <mliska@suse.cz>

	PR libgcc/92565
	* bid_internal.h (handle_UF_128_rem): Remove unused variable.
	(handle_UF_128): Likewise.
2020-05-05 15:54:56 +02:00
Uros Bizjak afb9b71081 i386: Use generic division to generate INVALID and DIVZERO exceptions
Introduce math_force_eval to evaluate generic division to generate
INVALID and DIVZERO exceptions.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__math_force_eval): New define.
	(__sfp_handle_exceptions): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.

libatomic/ChangeLog:

	* config/x86/fenv.c (__math_force_eval): New define.
	(__atomic_feraiseexcept): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.

libgfortran/ChangeLog:

	* config/fpu-387.h (__math_force_eval): New define.
	(local_feraiseexcept): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.
2020-05-01 19:20:57 +02:00
Sebastian Huber 6671127908 RS6000: Use .machine ppc for some CRT files
Since commit e154242724 the flag -many is
sometimes not passed to the assembler.  Use .machine ppc to prevent
errors if these files are assembled for an ISA which does not support
FPRs.

libgcc/

	* config/rs6000/crtresfpr.S: Use .machine ppc.
	* config/rs6000/crtresxfpr.S: Likewise.
	* config/rs6000/crtsavfpr.S: Likewise.
2020-04-27 07:45:54 +02:00
Szabolcs Nagy fb22faf48f aarch64, libgcc: Fix unwinding from pac-ret to normal frames [PR94514]
With -mbranch-protection=pac-ret the debug info toggles the
signedness state of the return address so the unwinder knows when
the return address needs pointer authentication.

The unwind context flags were not updated according to the dwarf
frame info.

This causes unwinding across frames that were built without pac-ret
to incorrectly authenticate the return address wich corrupts the
return address on a system where PAuth is enabled.

Note: This even affects systems where all code use pac-ret because
unwinding across a signal frame the return address is not signed.

gcc/testsuite/ChangeLog:

	PR target/94514
	* g++.target/aarch64/pr94514.C: New test.
	* gcc.target/aarch64/pr94514.c: New test.

libgcc/ChangeLog:

	PR target/94514
	* config/aarch64/aarch64-unwind.h (aarch64_frob_update_context):
	Update context->flags accroding to the frame state.
2020-04-21 17:49:01 +01:00
Uros Bizjak df73e5842f i386: Remove unneeded assignments when triggering SSE exceptions
According to "Intel 64 and IA32 Arch SDM, Vol. 3:

"Because SIMD floating-point exceptions are precise and occur immediately,
the situation does not arise where an x87 FPU instruction, a WAIT/FWAIT
instruction, or another SSE/SSE2/SSE3 instruction will catch a pending
unmasked SIMD floating-point exception."

Remove unneeded assignments to volatile memory.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__sfp_handle_exceptions) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.

libatomic/ChangeLog:

	* config/x86/fenv.c (__atomic_feraiseexcept) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.

libgfortran/ChangeLog:

	* config/fpu-387.h (local_feraiseexcept) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.
2020-04-19 14:27:12 +02:00
Jakub Jelinek 5b2f76e36d aarch64: Fix bootstrap with old binutils [PR93053]
As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build
when using older binutils which lack LSE support, because those instructions
are used in libgcc.
Thanks to Kyrylo's hint, the following patches (hopefully) allow it to build
even with older binutils by using .inst directive if LSE support isn't
available in the assembler.

2020-04-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/93053
	* configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking.
	* config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE
	is not defined, use just .arch armv8-a.
	(B, M, N, OPN): Define.
	(COMMENT): New .macro.
	(CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not
	defined.  Otherwise, move the operands right after the glue? and
	comment out operands where the macros are used.
	* configure: Regenerated.
	* config.in: Regenerated.
2020-04-15 11:01:19 +02:00
Ian Lance Taylor 50c7853216 libgcc: use syscall rather than __mmap/__munmap
PR libgcc/94513
	* generic-morestack.c: Give up trying to use __mmap/__munmap, use
	syscall instead.
2020-04-07 11:30:10 -07:00
Ian Lance Taylor 458ca332d1 libgcc: only use __mmap if glibc >- 2.26
* generic-morestack.c: Only use __mmap on glibc >= 2.26.
2020-04-04 13:47:19 -07:00
Ian Lance Taylor 710d54ed4e libgcc: avoid mmap/munmap hooks in split-stack code on GNU/Linux
* generic-morestack.c: On GNU/Linux use __mmap/__munmap rather
	than mmap/munmap, to avoid hooks.
2020-04-03 14:58:27 -07:00
Jim Johnston b749b5ec58 S/390 zTPF: Handle skip trace addresses when unwinding
Check for and handle new skip trace addresses when unwinding on zTPF.

libgcc/ChangeLog:

2020-04-03  Jim Johnston  <jjohnst@us.ibm.com>

	* config/s390/tpf-unwind.h (MIN_PATRANGE, MAX_PATRANGE)
	(TPFRA_OFFSET): Macros removed.
	(CP_CNF, cinfc_fast, CINFC_CMRESET, CINTFC_CMCENBKST)
	(CINTFC_CMCENBKED, ICST_CRET, ICST_SRET, LOWCORE_PAGE3_ADDR)
	(PG3_SKIPPING_OFFSET): New macros.
	(__isPATrange): Use cinfc_fast for the check.
	(__isSkipResetAddr): New function.
	(s390_fallback_frame_state): Check for skip trace addresses. Use
	either ICST_CRET or ICST_SRET to calculate return address
	location.
	(__tpf_eh_return): Handle skip trace addresses.
2020-04-03 08:46:11 +02:00
Richard Earnshaw a9cd2d786a fixup: move ChangeLog entry for last Arm fix to correct file.
PR target/94220
2020-03-27 10:23:38 +00:00
Richard Earnshaw e519d64499 arm: unified syntax for libgcc when built with -Os [PR94220]
The recent patch to convert all thumb1 code in libgcc to unified syntax
ommitted the conditional code that is used only when building the library
for minimal size.  This patch fixes this case.

I've also fixed the COND macro so that a single definition is always used
that is for unified syntax.  This eliminates a warning that is now being
seen from the assembler when compiling the ieee fp support code.

	PR target/94220
	* config/arm/lib1funcs.asm (COND): Use a single definition for
	unified syntax.
	(aeabi_uidivmod): Unified syntax when optimizing Thumb for size.
	(aeabi_idivmod): Likewise.
	(divsi3_skip_div0_test): Likewise.
2020-03-26 10:59:34 +00:00
Mihail Ionescu f582ca0fd7 [GCC][PATCH][ARM] Add multilib mapping for Armv8.1-M+MVE with -mfloat-abi=hard
This patch adds a new multilib for armv8.1-m.main+mve with hard float abi. For
armv8.1-m.main+mve soft and softfp, the v8-M multilibs will be reused.
The following mappings are also updated:
"-mfloat-abi=hard -march=armv8.1-m.main+mve.fp -> armv8-m.main+fp/hard"
"-mfloat-abi=softfp -march=armv8.1-m.main+mve.fp -> armv8-m.main+fp/softfp"
"-mfloat-abi=soft -march=armv8.1-m.main+mve.fp -> armv8-m.main/nofp"
gcc/ChangeLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

	* config/arm/t-rmprofile: create new multilib for
	armv8.1-m.main+mve hard float and reuse v8-m.main ones for
	v8.1-m.main+mve .

gcc/testsuite/ChangeLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

	* gcc.target/arm/multilib.exp: Add new v8.1-M entry.

libgcc/ChangLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

	* config/arm/t-arm: Do not compile cmse_nonsecure_call.S for v8.1-m.
2020-03-17 12:44:46 +00:00
Andreas Krebbel 068fe0a9e9 Add missing ChangeLog entries 2020-03-06 12:44:27 +01:00
Andreas Krebbel 0993851dc1 IBM Z: zTPF: Build libgcc with -mtpf-trace-skip
libgcc is supposed to be built with the trace skip flags and branch
targets.  Add a zTPF header file fragment and add the -mtpf-trace-skip
option.

libgcc/ChangeLog:

2020-03-04  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config.host: Include the new makefile fragment.
	* config/s390/t-tpf: New file.
2020-03-04 13:50:02 +01:00
Richard Earnshaw 6b9ce2b4eb libgcc: arm: convert thumb1 code to unified syntax
Unified syntax has been the official syntax for thumb1 assembly for
over 10 years now.  It's time we made preparations for that becoming
the default in the assembler.  But before we can start doing that we
really need to clean up some laggards from the olden days.  Libgcc
support for thumb1 is one such example.

This patch converts all of the legacy (disjoint) syntax that I could
find over to unified code.  The identification was done by using a
trick version of gas that defaulted to unified mode which then faults
if legacy syntax is encountered.  The code produced was then compared
against the old code to check for differences.  One such difference
does exist, but that is because in unified syntax 'movs rd, rn' is
encoded as 'lsls rd, rn, #0', rather than 'adds rd, rn, #0'; but that
is a deliberate change that was introduced because the lsls encoding
more closely reflects the behaviour of 'movs' in arm state (where only
some of the condition flags are modified).

	* config/arm/bpabi-v6m.S (aeabi_lcmp): Convert thumb1 code to unified
	syntax.
	(aeabi_ulcmp, aeabi_ldivmod, aeabi_uldivmod): Likewise.
	(aeabi_frsub, aeabi_cfcmpeq, aeabi_fcmpeq): Likewise.
	(aeabi_fcmp, aeabi_drsub, aeabi_cdrcmple): Likewise.
	(aeabi_cdcmpeq, aeabi_dcmpeq, aeabi_dcmp): Likewise.
	* config/arm/lib1funcs.S (Lend_fde): Convert thumb1 code to unified
	syntax.
	(divsi3, modsi3): Likewise.
	(clzdi2, ctzsi2): Likewise.
	* config/arm/libunwind.S (restore_core_regs): Convert thumb1 code to
	unified syntax.
	(UNWIND_WRAPPER): Likewise.
2020-03-03 16:02:24 +00:00
Martin Liska 8dd5d8f31a
Remove duplicate declaration.
* libgcov-interface.c: Remove duplicate
	declaration of __gcov_flush_mx.
2020-03-02 13:08:49 +01:00
Martin Liska ea0b12523d
Introduce -fprofile-reproducibility and support it with TOP N.
PR ipa/92924
	* common.opt: Add -fprofile-reproducibility.
	* doc/invoke.texi: Document it.
	* value-prof.c (dump_histogram_value):
	Document and support behavior for counters[0]
	being a negative value.
	(get_nth_most_common_value): Handle negative
	counters[0] in respect to flag_profile_reproducible.
	PR ipa/92924
	* libgcov-merge.c (merge_topn_values_set): Record
	when a TOP N counter becomes invalid.  When merging
	remove a smallest value if the space is needed.
2020-02-18 14:28:22 +01:00
Sandra Loosemore 02ce382cd3 Use a non-empty test program to test ability to link.
On bare-metal targets, I/O support is typically provided by a BSP and
requires a linker script and/or hosting library to be specified on the
linker command line.  Linking an empty program with the default linker
script may succeed, however, which confuses libstdc++ configuration
when programs that probe for the presence of various I/O features fail
with link errors.

2020-02-12  Sandra Loosemore  <sandra@codesourcery.com>

	PR libstdc++/79193
	PR libstdc++/88999

	config/
	* no-executables.m4: Use a non-empty program to test for linker
	support.

	libgcc/
	* configure: Regenerated.

	libgfortran/
	* configure: Regenerated.

	libiberty/
	* configure: Regenerated.

	libitm/
	* configure: Regenerated.

	libobjc/
	* configure: Regenerated.

	libquadmath/
	* configure: Regenerated.

	libssp/
	* configure: Regenerated.

	libstdc++v-3/
	* configure: Regenerated.
2020-02-12 13:22:07 -08:00
Jeff Law 7214fce302 Fix libgcc build failure for FRV with recent versions of gas.
* config/frv/frvbegin.c: Use right flags for .ctors and .dtors
	sections.
	* config/frv/frvend.c: Similarly.
2020-02-10 14:12:32 -07:00
H.J. Lu cf0f07ef0e Move ChangeLog entry of commit bf6465d046 from gcc to libgcc 2020-02-10 08:08:32 -08:00
H.J. Lu bf6465d046 i386: Properly pop restore token in signal frame
Linux CET kernel places a restore token on shadow stack for signal
handler to enhance security.  The restore token is 8 byte and aligned
to 8 bytes.  It is usually transparent to user programs since kernel
will pop the restore token when signal handler returns.  But when an
exception is thrown from a signal handler, now we need to pop the
restore token from shadow stack.  For x86-64, we just need to treat
the signal frame as normal frame.  For i386, we need to search for
the restore token to check if the original shadow stack is 8 byte
aligned.  If the original shadow stack is 8 byte aligned, we just
need to pop 2 slots, one restore token, from shadow stack.  Otherwise,
we need to pop 3 slots, one restore token + 4 byte padding, from
shadow stack.

This patch also includes 2 tests, one has a restore token with 4 byte
padding and one without.

Tested on Linux/x86-64 CET machine with and without -m32.

libgcc/

	PR libgcc/85334
	* config/i386/shadow-stack-unwind.h (_Unwind_Frames_Increment):
	New.

gcc/testsuite/

	PR libgcc/85334
	* g++.target/i386/pr85334-1.C: New test.
	* g++.target/i386/pr85334-2.C: Likewise.
2020-02-10 07:59:10 -08:00
Christophe Lyon 5602b48b2e arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615]
Commit r10-6500-g811a475ea3fcc55ee4aea7c81171891ef19dfc25 broke the
GCC build for arm-none-uclinuxfdpiceabi, as it forgot to update some
uses of gnu_Unwind_Find_got.

2020-02-10  Christophe Lyon  <christophe.lyon@linaro.org>

	libgcc/
	PR target/93615
	* unwind-arm-common.inc: Replace uses of gnu_Unwind_Find_got with
	_Unwind_gnu_Find_got.
	* unwind-pe.h: Likewise.
2020-02-10 14:35:31 +00:00
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
Jan Hubicka e3fe0070c1 libgcov: Fix merging of topn [PR92924]
PR tree-optimization/92924
	* libgcov-merge.c (merge_topn_values_set): Fix merging.
2020-01-24 12:12:17 +01:00