Commit Graph

1354 Commits

Author SHA1 Message Date
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