Commit Graph

1133 Commits

Author SHA1 Message Date
GCC Administrator f3c2cc8eaa Daily bump. 2021-01-14 00:18:33 +00:00
Samuel Thibault 23b1bb7b22 hurd: libgcc unwinding over signal trampolines with SIGINFO
When the application sets SA_SIGINFO, the signal trampoline parameters
are different to follow POSIX.

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

(cherry picked from commit 2b356e689c)
2021-01-13 11:56:29 +01:00
GCC Administrator 4ad02cfb76 Daily bump. 2020-08-08 00:18:22 +00:00
Jakub Jelinek 4e91af9877 aarch64: Fix up __aarch64_cas16_acq_rel fallback
As mentioned in the PR, the fallback path when LSE is unavailable writes
incorrect registers to the memory if the previous content compares equal
to x0, x1 - it writes copy of x0, x1 from the start of function, but it
should write x2, x3.

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

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

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

(cherry picked from commit 90b43856fd)
2020-08-07 13:26:27 +01:00
GCC Administrator 0eca9685d1 Daily bump. 2020-07-17 00:18:14 +00:00
Szabolcs Nagy f5cab58621 libgcc: fix the handling of return address mangling [PR94891]
Mangling, currently only used on AArch64 for return address signing,
is an internal representation that should not be exposed via

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

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

This patch changes the unwinder hooks as follows:

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

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

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

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

libgcc/ChangeLog:

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

(cherry picked from commit b097c7a27f)
2020-07-16 14:05:04 +01:00
Szabolcs Nagy 315a7e8cca 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.

(cherry picked from commit f0f62fa032)
2020-07-16 13:46:36 +01:00
Szabolcs Nagy be6028a7a6 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.

(cherry picked from commit e73ec75548)
2020-07-16 13:46:36 +01:00
GCC Administrator 5e91fc4718 Daily bump. 2020-06-18 00:18:27 +00:00
Samuel Thibault cd32b2c51b 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>
(cherry picked from commit 5e2eebc80d)
2020-06-18 00:03:23 +02:00
GCC Administrator 59f2c72055 Daily bump. 2020-05-30 00:18:15 +00:00
Kyrylo Tkachov b6dc99434a [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__.

(cherry picked from commit 1266778548)
2020-05-29 14:01:34 +01:00
Martin Liska a243b63169
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.

(cherry picked from commit 17d1594bfe)
2020-05-29 11:38:46 +02:00
H.J. Lu d7796c9d0c x86: Update VPCLMULQDQ check
Update VPCLMULQDQ check to support processors with AVX version of
VPCLMULQDQ.

	Backport from master
	PR target/91695
	* config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ
	check.

(cherry picked from commit 1e46a443f2)
2020-05-21 04:00:58 -07:00
H.J. Lu 2c7b747995 x86: Update GFNI check
Update GFNI check to support processors with SSE and AVX versions of GFNI.

	Backport from master
	PR target/95220
	* config/i386/cpuinfo.c (get_available_features): Fix
	FEATURE_GFNI check.
2020-05-19 15:53:01 -07:00
Szabolcs Nagy 6173489dbf 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:

	Backport from mainline.
	2020-04-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR target/94514
	* g++.target/aarch64/pr94514.C: Require lp64.
	* gcc.target/aarch64/pr94514.c: Likewise.

	Backport from mainline.
	2020-04-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

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

libgcc/ChangeLog:

	Backport from mainline.
	2020-04-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR target/94514
	* config/aarch64/aarch64-unwind.h (aarch64_frob_update_context):
	Update context->flags accroding to the frame state.
2020-05-14 12:57:37 +01:00
Andre Vieira bfe912a35c 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-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	Backport from mainline.
	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-22 15:16:20 +01:00
Uros Bizjak 84282b05a8 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 15:32:17 +02:00
Kyrylo Tkachov c15ff4d080 aarch64: Configure for sys/auxv.h in libgcc for lse-init.c
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

	PR target/91833
	* config/aarch64/lse-init.c: Include auto-target.h.  Disable
	initialization if !HAVE_SYS_AUXV_H.
	* configure.ac (AC_CHECK_HEADERS): Add sys/auxv.h.
	* config.in, configure: Rebuild.
2020-04-01 12:13:39 +01:00
Kyrylo Tkachov bb9156ede0 aarch64: Fix store-exclusive in load-operate LSE helpers
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

	PR target/91834
	* config/aarch64/lse.S (LDNM): Ensure STXR output does not
	overlap the inputs.
2020-04-01 12:11:58 +01:00
Kyrylo Tkachov b36f6a808e aarch64: Add out-of-line functions for LSE atomics
This is the libgcc part of the interface -- providing the functions.
Rationale is provided at the top of libgcc/config/aarch64/lse.S.

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

	* config/aarch64/lse-init.c: New file.
	* config/aarch64/lse.S: New file.
	* config/aarch64/t-lse: New file.
	* config.host: Add t-lse to all aarch64 tuples.
2020-04-01 11:56:24 +01:00
Jakub Jelinek 4212a6a3e4 Update ChangeLog and version files for release 2020-03-12 11:08:05 +00:00
Joseph Myers 096ba1951f Revert "setup branch"
This reverts commit 65e894738f.

Commit appears to have been made on the wrong branch, and breaks
contrib/gcc_update because it checks in a file gcc/REVISION.
2020-02-26 21:08:19 +00:00
Michael Meissner 65e894738f setup branch 2020-02-26 15:56:56 -05:00
H.J. Lu 3fde339834 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/

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

gcc/testsuite/

	Backport from mainline
	PR libgcc/85334
	* g++.target/i386/pr85334-1.C: New test.
	* g++.target/i386/pr85334-2.C: Likewise.

(cherry picked from commit bf6465d046)
2020-02-10 08:10:49 -08:00
John David Anglin dbbbe55ecd linux-atomic.c (__kernel_cmpxchg): Change argument 1 to volatile void *.
* config/pa/linux-atomic.c (__kernel_cmpxchg): Change argument 1 to
	volatile void *.  Remove trap check.
	(__kernel_cmpxchg2): Likewise.
	(FETCH_AND_OP_2): Adjust operand types.
	(OP_AND_FETCH_2): Likewise.
	(FETCH_AND_OP_WORD): Likewise.
	(OP_AND_FETCH_WORD): Likewise.
	(COMPARE_AND_SWAP_2): Likewise.
	(__sync_val_compare_and_swap_4): Likewise.
	(__sync_bool_compare_and_swap_4): Likewise.
	(SYNC_LOCK_TEST_AND_SET_2): Likewise.
	(__sync_lock_test_and_set_4): Likewise.
	(SYNC_LOCK_RELEASE_1): Likewise.  Use __kernel_cmpxchg2 for release.
	(__sync_lock_release_4): Adjust operand types.  Use __kernel_cmpxchg
	for release.
	(__sync_lock_release_8): Remove.

From-SVN: r278378
2019-11-17 23:15:29 +00:00
Iain Sandoe bad5112682 [Darwin] Some TLC for older Darwin versions.
This is part 3 of build fixes for older Darwin versions (and will also
fix testsuite complaints about linkage with objects that are built for
an newer OS version than is being built, when used with a modern linker).

The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat. This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

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

gcc/

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

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

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

libgcc/

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

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

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

From-SVN: r277644
2019-10-30 20:38:47 +00:00
Iain Sandoe 77908128e4 [Darwin, PPC] Move the out of line register save/restore to an endfile.
Part 2 of fixes to build and link conditions for older Darwin versions.

We have been including these endfiles in libgcc, which means that we have to
append -lgcc even when using shared libgcc.  In preparation for revision of
libgcc split this into an endfile.  Build the new version.

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

	Backport from mainline.
	2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

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

From-SVN: r277642
2019-10-30 20:25:33 +00:00
John David Anglin 68397a8ff9 fptr.c (_dl_read_access_allowed): Change argument to unsigned int.
* config/pa/fptr.c (_dl_read_access_allowed): Change argument to
	unsigned int.  Adjust callers.
	(__canonicalize_funcptr_for_compare): Change plabel type to volatile
	unsigned int *.  Load relocation offset before function pointer.
	Add barrier to ensure ordering.

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

From-SVN: r276927
2019-10-12 19:44:29 +00:00
Jakub Jelinek a0c06cc27d Update ChangeLog and version files for release
From-SVN: r274274
2019-08-12 09:38:49 +02:00
Iain Sandoe 9535e8591c Darwin, ppc, backport build fix for unwinder.
When libgcc is built on Darwin, it is usually built for the earliest potential
target (Darwin8, 10.4). Build for that revision default to assuming that the
processor might be G3 (without vector ops) and there is an outlined function
used for save/restore that checks whether the processor is G3 or G4+ at run-
time. However, the unwinder itself needs to be built with the assumption of
vector usage so that the relevant outlined functions are called.

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

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

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

From-SVN: r274043
2019-08-03 19:36:37 +00:00
Iain Sandoe b5fbe4b03b Darwin, ppc, backport build fix.
libgcc/

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

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

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

From-SVN: r274013
2019-08-02 14:19:42 +00:00
John David Anglin 3f1a94a570 linux-unwind.h (pa32_fallback_frame_state): Add cast.
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast.

From-SVN: r271632
2019-05-26 15:19:12 +00:00
Michael Meissner 37a457e395 Delete unintentional file from the wrong branch
From-SVN: r270876
2019-05-04 15:40:37 +00:00
Michael Meissner 2dea4b1e49 Delete unintentional file from the wrong branch
From-SVN: r270875
2019-05-04 15:39:52 +00:00
Michael Meissner 8cb953d5d2 setup branch
From-SVN: r270863
2019-05-03 22:33:10 +00:00
GCC Administrator c8913260b0 Update ChangeLog and version files for release
From-SVN: r270839
2019-05-03 07:59:54 +00:00
Ramana Radhakrishnan 48528842bd re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose
	if used with general-regs-only.
	(arm_conditional_register_usage): Don't add non-general regs if
	general-regs-only.
	(arm_valid_target_attribute_rec): Handle general-regs-only.
	* config/arm/arm.h (TARGET_HARD_FLOAT): Return false if
	general-regs-only.
	(TARGET_HARD_FLOAT_SUB): Define.
	(TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB.
	(TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY.
	(TARGET_REALLY_IWMMXT2): Likewise.
	* config/arm/arm.opt: Add -mgeneral-regs-only.
	* doc/extend.texi: Document ARM general-regs-only target.
	* doc/invoke.texi: Document ARM -mgeneral-regs-only.
libgcc/
	* config/arm/pr-support.c: Add #pragma GCC target("general-regs-only").
	* config/arm/unwind-arm.c: Likewise.
	* unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libobjc/
	* exception.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libphobos/
	* libdruntime/gcc/deh.d: Import gcc.attribute.
	(personality_fn_attributes): New enum.
	(scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality):
	Add @personality_fn_attributes.
libstdc++-v3/
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add
	general-regs-only target attribute for ARM.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r270504
2019-04-23 12:03:41 +02:00
Monk Chiang 887e182f05 [NDS32] Refine force unwind. Linux kernel only uses RT_SIGRETURN.
libgcc/
	* config/nds32/linux-unwind.h (SIGRETURN): Remove.
	(RT_SIGRETURN): Update.
	(nds32_fallback_frame_state): Update.

From-SVN: r270363
2019-04-15 08:19:23 +00:00
Martin Sebor a90b0cdd44 extend.texi (__clear_cache): Correct signature.
gcc/ChangeLog:

	* doc/extend.texi (__clear_cache): Correct signature.

libgcc/ChangeLog:

	* libgcc2.h (__clear_cache): Correct signature.
	* libgcc2.c (__clear_cache): Same.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269082
2019-02-21 16:23:12 -07:00
Uros Bizjak 1ed28eda9f linux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.
* config/alpha/linux-unwind.h (alpha_fallback_frame_state):
	Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

From-SVN: r269053
2019-02-20 22:37:21 +01:00
Uros Bizjak fe95aee9ce unwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.
* unwind-dw2.c (_Unwind_GetGR) [DWARF_ZERO_REG]: Compare
	regno instead of index to DWARF_ZERO_REG.

From-SVN: r269021
2019-02-19 17:10:00 +01:00
Eric Botcazou bf7988f1e9 lib2funcs.c (__set_trampoline_parity): Replace TRAMPOLINE_SIZE with __LIBGCC_TRAMPOLINE_SIZE__.
libgcc/
	* config/visium/lib2funcs.c (__set_trampoline_parity): Replace
	TRAMPOLINE_SIZE with __LIBGCC_TRAMPOLINE_SIZE__.
gcc/
	* final.c (insn_current_reference_address): Replace test on JUMP_P
	with test on jump_to_label_p.
	* config/visium/visium-passes.def: New file.
	* config/visium/t-visium (PASSES_EXTRA): Define.
	* config/visium/visium-protos.h (make_pass_visium_reorg): Declare.
	* config/visium/visium.h (TRAMPOLINE_SIZE): Adjust.
	(TRAMPOLINE_ALIGNMENT): Define.
	* config/visium/visium.c (visium_option_override): Do not register
	the machine-specific reorg pass here.
	(visium_trampoline_init): Align the BRA insn on a 64-bit boundary
	for the GR6.
	(output_branch): Adjust threshold for long branch instruction.
	* config/visium/visium.md (cpu): Move around.
	(length): Adjust for the GR6.

From-SVN: r268931
2019-02-15 10:40:34 +00:00
Uros Bizjak ba2c1ca8c3 t-linux: Add -mfp-rounding-mode=d to HOST_LIBGCC2_CFLAGS.
* config/alpha/t-linux: Add -mfp-rounding-mode=d
	to HOST_LIBGCC2_CFLAGS.

From-SVN: r268430
2019-01-31 21:49:02 +01:00
Uros Bizjak d1ac2471e7 sfp-exceptions.c (__sfp_handle_exceptions): Remove stray semicolon.
* config/i386/sfp-exceptions.c (__sfp_handle_exceptions):
	Remove stray semicolon.

From-SVN: r268405
2019-01-31 00:09:40 +01:00
H.J. Lu 6395ba73f8 libgcc2.c: Correct DI/TI -> SF/DF conversions
FSTYPE FUNC (DWtype u) in libgcc2.c, which converts DI/TI to SF/DF, has

  /* No leading bits means u == minimum.  */
  if (count == 0)
    return -(Wtype_MAXp1_F * (Wtype_MAXp1_F / 2));

in the third case (where actually count == 0 only means the high part is
minimum).  It should be:

  /* No leading bits means u == minimum.  */
  if (count == 0)
    return Wtype_MAXp1_F * (FSTYPE) (hi | ((UWtype) u != 0));

instead.

gcc/testsuite/

2019-01-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR libgcc/88931
	* gcc.dg/torture/fp-int-convert-timode-1.c: New test.
	* gcc.dg/torture/fp-int-convert-timode-2.c: Likewise.
	* gcc.dg/torture/fp-int-convert-timode-3.c: Likewise.
	* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.

libgcc/

2019-01-23  Joseph Myers  <joseph@codesourcery.com>

	PR libgcc/88931
	* libgcc2.c (FSTYPE FUNC (DWtype u)): Correct no leading bits
	case.

From-SVN: r268216
2019-01-23 13:41:59 -08:00
Martin Liska 756721ba89 Bump version of __gcov_indirect_call_profiler function as there was ABI change.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* params.def: Fix comment.
	* tree-profile.c (gimple_init_gcov_profiler): Bump function
	name.
	(gimple_gen_ic_func_profiler): Likewise.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* gcc.dg/no_profile_instrument_function-attr-1.c: Update
	expected function name.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Rename
	to ...
	(__gcov_indirect_call_profiler_v3): ... this.
	* libgcov.h (__gcov_indirect_call_profiler_v2): Likewise.
	(__gcov_indirect_call_profiler_v3): Likewise.
	* Makefile.in: Bump function name.

From-SVN: r268071
2019-01-18 11:32:53 +00:00
Martin Liska d273c40a55 Update error message prefix in libgcov profiling.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (GCOV_PROF_PREFIX): Define.
	(gcov_version): Use in gcov_error.
	(merge_one_data): Likewise.
	(dump_one_gcov): Likewise.

From-SVN: r268070
2019-01-18 11:31:45 +00:00
Martin Liska be9d9fdbed Describe better version mismatch in libgcov driver.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (gcov_version_string): New function.
	(gcov_version): Convert version integer into string.

From-SVN: r268069
2019-01-18 11:30:56 +00:00