From 5b2f76e36d861c881c6770b4f47c1fae6c0c8965 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 15 Apr 2020 11:01:19 +0200 Subject: 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 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. --- libgcc/ChangeLog | 14 +++++++++++ libgcc/config.in | 3 +++ libgcc/config/aarch64/lse.S | 57 ++++++++++++++++++++++++++++++++++++++------- libgcc/configure | 40 +++++++++++++++++++++++++++++++ libgcc/configure.ac | 19 +++++++++++++++ 5 files changed, 125 insertions(+), 8 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 6340cfb..3426ff8 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,17 @@ +2020-04-15 Jakub Jelinek + + 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-07 Ian Lance Taylor PR libgcc/94513 diff --git a/libgcc/config.in b/libgcc/config.in index 59a3d8d..5be5321 100644 --- a/libgcc/config.in +++ b/libgcc/config.in @@ -10,6 +10,9 @@ */ #undef HAVE_AS_CFI_SECTIONS +/* Define to 1 if the assembler supports LSE. */ +#undef HAVE_AS_LSE + /* Define to 1 if the target assembler supports thread-local storage. */ #undef HAVE_CC_TLS diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S index ca6495f..f3ccf5c 100644 --- a/libgcc/config/aarch64/lse.S +++ b/libgcc/config/aarch64/lse.S @@ -48,8 +48,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * separately to minimize code size. */ +#include "auto-target.h" + /* Tell the assembler to accept LSE instructions. */ +#ifdef HAVE_AS_LSE .arch armv8-a+lse +#else + .arch armv8-a +#endif /* Declare the symbol gating the LSE implementations. */ .hidden __aarch64_have_lse_atomics @@ -58,12 +64,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if SIZE == 1 # define S b # define UXT uxtb +# define B 0x00000000 #elif SIZE == 2 # define S h # define UXT uxth +# define B 0x40000000 #elif SIZE == 4 || SIZE == 8 || SIZE == 16 # define S # define UXT mov +# if SIZE == 4 +# define B 0x80000000 +# elif SIZE == 8 +# define B 0xc0000000 +# endif #else # error #endif @@ -72,18 +85,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define SUFF _relax # define A # define L +# define M 0x000000 +# define N 0x000000 #elif MODEL == 2 # define SUFF _acq # define A a # define L +# define M 0x400000 +# define N 0x800000 #elif MODEL == 3 # define SUFF _rel # define A # define L l +# define M 0x008000 +# define N 0x400000 #elif MODEL == 4 # define SUFF _acq_rel # define A a # define L l +# define M 0x408000 +# define N 0xc00000 #else # error #endif @@ -144,9 +165,13 @@ STARTFN NAME(cas) JUMP_IF_NOT_LSE 8f #if SIZE < 16 -#define CAS glue4(cas, A, L, S) +#ifdef HAVE_AS_LSE +# define CAS glue4(cas, A, L, S) s(0), s(1), [x2] +#else +# define CAS .inst 0x08a07c41 + B + M +#endif - CAS s(0), s(1), [x2] + CAS /* s(0), s(1), [x2] */ ret 8: UXT s(tmp0), s(0) @@ -160,9 +185,13 @@ STARTFN NAME(cas) #else #define LDXP glue3(ld, A, xp) #define STXP glue3(st, L, xp) -#define CASP glue3(casp, A, L) +#ifdef HAVE_AS_LSE +# define CASP glue3(casp, A, L) x0, x1, x2, x3, [x4] +#else +# define CASP .inst 0x48207c82 + M +#endif - CASP x0, x1, x2, x3, [x4] + CASP /* x0, x1, x2, x3, [x4] */ ret 8: mov x(tmp0), x0 @@ -181,12 +210,16 @@ ENDFN NAME(cas) #endif #ifdef L_swp -#define SWP glue4(swp, A, L, S) +#ifdef HAVE_AS_LSE +# define SWP glue4(swp, A, L, S) s(0), s(0), [x1] +#else +# define SWP .inst 0x38208020 + B + N +#endif STARTFN NAME(swp) JUMP_IF_NOT_LSE 8f - SWP s(0), s(0), [x1] + SWP /* s(0), s(0), [x1] */ ret 8: mov s(tmp0), s(0) @@ -204,24 +237,32 @@ ENDFN NAME(swp) #ifdef L_ldadd #define LDNM ldadd #define OP add +#define OPN 0x0000 #elif defined(L_ldclr) #define LDNM ldclr #define OP bic +#define OPN 0x1000 #elif defined(L_ldeor) #define LDNM ldeor #define OP eor +#define OPN 0x2000 #elif defined(L_ldset) #define LDNM ldset #define OP orr +#define OPN 0x3000 #else #error #endif -#define LDOP glue4(LDNM, A, L, S) +#ifdef HAVE_AS_LSE +# define LDOP glue4(LDNM, A, L, S) s(0), s(0), [x1] +#else +# define LDOP .inst 0x38200020 + OPN + B + N +#endif STARTFN NAME(LDNM) JUMP_IF_NOT_LSE 8f - LDOP s(0), s(0), [x1] + LDOP /* s(0), s(0), [x1] */ ret 8: mov s(tmp0), s(0) diff --git a/libgcc/configure b/libgcc/configure index 093036a..26bf757 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5530,6 +5530,46 @@ $as_echo "#define HAVE_AS_AVX 1" >>confdefs.h ;; esac + + +case "${target}" in +aarch64*-*-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports LSE" >&5 +$as_echo_n "checking if the assembler supports LSE... " >&6; } +if ${libgcc_cv_as_lse+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + asm(".arch armv8-a+lse\n\tcas w0, w1, [x2]"); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libgcc_cv_as_lse=yes +else + libgcc_cv_as_lse=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_as_lse" >&5 +$as_echo "$libgcc_cv_as_lse" >&6; } + if test x$libgcc_cv_as_lse = xyes; then + +$as_echo "#define HAVE_AS_LSE 1" >>confdefs.h + + fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for init priority support" >&5 $as_echo_n "checking for init priority support... " >&6; } if ${libgcc_cv_init_priority+:} false; then : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 85979da9..bff6e54 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -599,6 +599,25 @@ i[[34567]]86-*-* | x86_64-*-*) esac]) LIBGCC_CHECK_AS_AVX +dnl Check if as supports LSE instructions. +AC_DEFUN([LIBGCC_CHECK_AS_LSE], [ +case "${target}" in +aarch64*-*-*) + AC_CACHE_CHECK([if the assembler supports LSE], libgcc_cv_as_lse, [ + AC_TRY_COMPILE([], +changequote(,)dnl + asm(".arch armv8-a+lse\n\tcas w0, w1, [x2]"); +changequote([,])dnl + , + [libgcc_cv_as_lse=yes], [libgcc_cv_as_lse=no]) + ]) + if test x$libgcc_cv_as_lse = xyes; then + AC_DEFINE(HAVE_AS_LSE, 1, [Define to 1 if the assembler supports LSE.]) + fi + ;; +esac]) +LIBGCC_CHECK_AS_LSE + dnl Check if as supports RTM instructions. AC_CACHE_CHECK(for init priority support, libgcc_cv_init_priority, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, -- cgit v1.1 From df73e5842f25aea3bab81c328ed77f16ed261b33 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 19 Apr 2020 14:23:47 +0200 Subject: 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. --- libgcc/ChangeLog | 5 +++++ libgcc/config/i386/sfp-exceptions.c | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 3426ff8..d66f76f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-04-19 Uroš Bizjak + + * config/i386/sfp-exceptions.c (__sfp_handle_exceptions) [__SSE_MATH__]: + Remove unneeded assignments to volatile memory. + 2020-04-15 Jakub Jelinek PR target/93053 diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index c994491..31a24ce 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -48,9 +48,7 @@ __sfp_handle_exceptions (int _fex) { float f = 0.0f; #ifdef __SSE_MATH__ - volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%0, %d0|%d0, %0}" : "+x" (f)); - r = f; /* Needed to trigger exception. */ #else asm volatile ("fdiv\t{%y0, %0|%0, %y0}" : "+t" (f)); /* No need for fwait, exception is triggered by emitted fstp. */ @@ -68,9 +66,7 @@ __sfp_handle_exceptions (int _fex) { float f = 1.0f, g = 0.0f; #ifdef __SSE_MATH__ - volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); - r = f; /* Needed to trigger exception. */ #else asm volatile ("fdivs\t%1" : "+t" (f) : "m" (g)); /* No need for fwait, exception is triggered by emitted fstp. */ @@ -96,9 +92,7 @@ __sfp_handle_exceptions (int _fex) { float f = 1.0f, g = 3.0f; #ifdef __SSE_MATH__ - volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); - r = f; /* Needed to trigger exception. */ #else asm volatile ("fdivs\t%1" : "+t" (f) : "m" (g)); /* No need for fwait, exception is triggered by emitted fstp. */ -- cgit v1.1 From fb22faf48f6eb518932f24005f8606e5f19a7304 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 3 Apr 2020 09:35:41 +0000 Subject: 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. --- libgcc/ChangeLog | 6 ++++++ libgcc/config/aarch64/aarch64-unwind.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d66f76f..da419ff 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-04-21 Szabolcs Nagy + + PR target/94514 + * config/aarch64/aarch64-unwind.h (aarch64_frob_update_context): + Update context->flags accroding to the frame state. + 2020-04-19 Uroš Bizjak * config/i386/sfp-exceptions.c (__sfp_handle_exceptions) [__SSE_MATH__]: diff --git a/libgcc/config/aarch64/aarch64-unwind.h b/libgcc/config/aarch64/aarch64-unwind.h index 4c8790b..ed84a96 100644 --- a/libgcc/config/aarch64/aarch64-unwind.h +++ b/libgcc/config/aarch64/aarch64-unwind.h @@ -104,6 +104,8 @@ aarch64_frob_update_context (struct _Unwind_Context *context, if (fs->regs.reg[DWARF_REGNUM_AARCH64_RA_STATE].loc.offset & 0x1) /* The flag is used for re-authenticating EH handler's address. */ context->flags |= RA_SIGNED_BIT; + else + context->flags &= ~RA_SIGNED_BIT; return; } -- cgit v1.1 From 66711279083121b07d909ac0fc2f3a744ac7c937 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 6 Apr 2020 22:30:21 +0200 Subject: RS6000: Use .machine ppc for some CRT files Since commit e154242724b084380e3221df7c08fcdbd8460674 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. --- libgcc/ChangeLog | 6 ++++++ libgcc/config/rs6000/crtresfpr.S | 1 + libgcc/config/rs6000/crtresxfpr.S | 1 + libgcc/config/rs6000/crtsavfpr.S | 1 + 4 files changed, 9 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index da419ff..7dbab3e 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-04-27 Sebastian Huber + + * config/rs6000/crtresfpr.S: Use .machine ppc. + * config/rs6000/crtresxfpr.S: Likewise. + * config/rs6000/crtsavfpr.S: Likewise. + 2020-04-21 Szabolcs Nagy PR target/94514 diff --git a/libgcc/config/rs6000/crtresfpr.S b/libgcc/config/rs6000/crtresfpr.S index 6c0d01b..99e6f08 100644 --- a/libgcc/config/rs6000/crtresfpr.S +++ b/libgcc/config/rs6000/crtresfpr.S @@ -27,6 +27,7 @@ /* Do any initializations needed for the eabi environment */ + .machine ppc .section ".text" #include "ppc-asm.h" diff --git a/libgcc/config/rs6000/crtresxfpr.S b/libgcc/config/rs6000/crtresxfpr.S index 9f01fa5..9931db2 100644 --- a/libgcc/config/rs6000/crtresxfpr.S +++ b/libgcc/config/rs6000/crtresxfpr.S @@ -27,6 +27,7 @@ /* Do any initializations needed for the eabi environment */ + .machine ppc .section ".text" #include "ppc-asm.h" diff --git a/libgcc/config/rs6000/crtsavfpr.S b/libgcc/config/rs6000/crtsavfpr.S index fa043dd..dd8743a 100644 --- a/libgcc/config/rs6000/crtsavfpr.S +++ b/libgcc/config/rs6000/crtsavfpr.S @@ -27,6 +27,7 @@ /* Do any initializations needed for the eabi environment */ + .machine ppc .section ".text" #include "ppc-asm.h" -- cgit v1.1 From afb9b7108104a73e8ac7a9b8e6875870e5ca4bbb Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 1 May 2020 19:20:57 +0200 Subject: 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. --- libgcc/ChangeLog | 6 ++++++ libgcc/config/i386/sfp-exceptions.c | 20 ++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7dbab3e..02b36d3 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-05-01 Uroš Bizjak + + * 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. + 2020-04-27 Sebastian Huber * config/rs6000/crtresfpr.S: Use .machine ppc. diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index 31a24ce..4b3a7a0 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -41,18 +41,19 @@ struct fenv unsigned short int __unused5; }; +#ifdef __SSE_MATH__ +# define __math_force_eval(x) asm volatile ("" : : "x" (x)); +#else +# define __math_force_eval(x) asm volatile ("" : : "f" (x)); +#endif + void __sfp_handle_exceptions (int _fex) { if (_fex & FP_EX_INVALID) { float f = 0.0f; -#ifdef __SSE_MATH__ - asm volatile ("%vdivss\t{%0, %d0|%d0, %0}" : "+x" (f)); -#else - asm volatile ("fdiv\t{%y0, %0|%0, %y0}" : "+t" (f)); - /* No need for fwait, exception is triggered by emitted fstp. */ -#endif + __math_force_eval (f / f); } if (_fex & FP_EX_DENORM) { @@ -65,12 +66,7 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_DIVZERO) { float f = 1.0f, g = 0.0f; -#ifdef __SSE_MATH__ - asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); -#else - asm volatile ("fdivs\t%1" : "+t" (f) : "m" (g)); - /* No need for fwait, exception is triggered by emitted fstp. */ -#endif + __math_force_eval (f / g); } if (_fex & FP_EX_OVERFLOW) { -- cgit v1.1 From 8b33430b53b2a884f177f1d9b40ed840e07240c5 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 4 Feb 2020 14:54:51 +0100 Subject: Remove 2 dead variables in bid_internal.h. libgcc/config/libbid/ChangeLog: 2020-02-04 Martin Liska PR libgcc/92565 * bid_internal.h (handle_UF_128_rem): Remove unused variable. (handle_UF_128): Likewise. --- libgcc/config/libbid/bid_internal.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config/libbid/bid_internal.h b/libgcc/config/libbid/bid_internal.h index cef36a9..9baa098 100644 --- a/libgcc/config/libbid/bid_internal.h +++ b/libgcc/config/libbid/bid_internal.h @@ -1540,8 +1540,6 @@ handle_UF_128_rem (UINT128 * pres, UINT64 sgn, int expon, UINT128 CQ, __shr_128 (CQ, Qh, amount); } - expon = 0; - #ifndef IEEE_ROUND_NEAREST_TIES_AWAY #ifndef IEEE_ROUND_NEAREST if (!(*prounding_mode)) @@ -1676,8 +1674,6 @@ handle_UF_128 (UINT128 * pres, UINT64 sgn, int expon, UINT128 CQ, __shr_128 (CQ, Qh, amount); } - expon = 0; - #ifndef IEEE_ROUND_NEAREST_TIES_AWAY #ifndef IEEE_ROUND_NEAREST if (!(*prounding_mode)) -- cgit v1.1 From af2311abf8a13cdfe00bfa44453bb02c38b0b5d8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 5 May 2020 16:10:13 +0200 Subject: Add missing ChangeLog entries. --- libgcc/config/libbid/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog index 0920863..a1a9f46 100644 --- a/libgcc/config/libbid/ChangeLog +++ b/libgcc/config/libbid/ChangeLog @@ -1,3 +1,9 @@ +2020-05-05 Martin Liska + + PR libgcc/92565 + * bid_internal.h (handle_UF_128_rem): Remove unused variable. + (handle_UF_128): Likewise. + 2020-01-01 Jakub Jelinek Update copyright years. -- cgit v1.1 From d39f7dc8d558ca31a661b02d08ff090ce65e6652 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 5 May 2020 16:15:45 +0200 Subject: 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. --- libgcc/ChangeLog | 13 ++++++++++ libgcc/Makefile.in | 3 ++- libgcc/libgcov-interface.c | 59 ++++++++++++++++++++++++++++++++++------------ libgcc/libgcov.h | 6 +++++ 4 files changed, 65 insertions(+), 16 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 02b36d3..fbf2bd1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,16 @@ +2020-05-05 Martin Liska + + 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-01 Uroš Bizjak * config/i386/sfp-exceptions.c (__math_force_eval): New define. diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 851e765..e6ed153 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -906,7 +906,8 @@ LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_time_profiler LIBGCOV_INTERFACE = _gcov_dump _gcov_flush _gcov_fork \ _gcov_execl _gcov_execlp \ - _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset + _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset \ + _gcov_lock_unlock LIBGCOV_DRIVER = _gcov libgcov-merge-objects = $(patsubst %,%$(objext),$(LIBGCOV_MERGE)) diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c index 048b902..a8054ed 100644 --- a/libgcc/libgcov-interface.c +++ b/libgcc/libgcov-interface.c @@ -42,18 +42,9 @@ void __gcov_dump (void) {} #else -/* Some functions we want to bind in this dynamic object, but have an - overridable global alias. Unfortunately not all targets support - aliases, so we just have a forwarding function. That'll be tail - called, so the cost is a single jump instruction.*/ - -#define ALIAS_void_fn(src,dst) \ - void dst (void) \ - { src (); } - extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; -#ifdef L_gcov_flush +#ifdef L_gcov_lock_unlock #ifdef __GTHREAD_MUTEX_INIT __gthread_mutex_t __gcov_flush_mx = __GTHREAD_MUTEX_INIT; #define init_mx_once() @@ -74,6 +65,25 @@ init_mx_once (void) } #endif +/* Lock critical section for __gcov_dump and __gcov_reset functions. */ + +void +__gcov_lock (void) +{ + init_mx_once (); + __gthread_mutex_lock (&__gcov_flush_mx); +} + +/* Unlock critical section for __gcov_dump and __gcov_reset functions. */ + +void +__gcov_unlock (void) +{ + __gthread_mutex_unlock (&__gcov_flush_mx); +} +#endif + +#ifdef L_gcov_flush /* Called before fork or exec - write out profile information gathered so far and reset it to zero. This avoids duplication or loss of the profile information gathered so far. */ @@ -81,13 +91,12 @@ init_mx_once (void) void __gcov_flush (void) { - init_mx_once (); - __gthread_mutex_lock (&__gcov_flush_mx); + __gcov_lock (); __gcov_dump_int (); __gcov_reset_int (); - __gthread_mutex_unlock (&__gcov_flush_mx); + __gcov_unlock (); } #endif /* L_gcov_flush */ @@ -143,7 +152,17 @@ __gcov_reset_int (void) } } -ALIAS_void_fn (__gcov_reset_int, __gcov_reset); +/* Exported function __gcov_reset. */ + +void +__gcov_reset (void) +{ + __gcov_lock (); + + __gcov_reset_int (); + + __gcov_unlock (); +} #endif /* L_gcov_reset */ @@ -163,7 +182,17 @@ __gcov_dump_int (void) __gcov_dump_one (root); } -ALIAS_void_fn (__gcov_dump_int, __gcov_dump); +/* Exported function __gcov_dump. */ + +void +__gcov_dump (void) +{ + __gcov_lock (); + + __gcov_dump_int (); + + __gcov_unlock (); +} #endif /* L_gcov_dump */ diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 023293e..104b80b 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -253,6 +253,12 @@ extern void __gcov_reset_int (void) ATTRIBUTE_HIDDEN; /* User function to enable early write of profile information so far. */ extern void __gcov_dump_int (void) ATTRIBUTE_HIDDEN; +/* Lock critical section for __gcov_dump and __gcov_reset functions. */ +extern void __gcov_lock (void) ATTRIBUTE_HIDDEN; + +/* Unlock critical section for __gcov_dump and __gcov_reset functions. */ +extern void __gcov_unlock (void) ATTRIBUTE_HIDDEN; + /* The merge function that just sums the counters. */ extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; -- cgit v1.1 From c0532db47d092430f8e8f497b2dc53343527bb13 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 5 May 2020 16:15:46 +0200 Subject: 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. --- libgcc/ChangeLog | 13 ++++++++++ libgcc/libgcov-interface.c | 59 +++++++++++++++++++++++++++++++++------------- 2 files changed, 56 insertions(+), 16 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index fbf2bd1..6ef5eb9 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,6 +1,19 @@ 2020-05-05 Martin Liska 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 Martin Liska + + PR gcov-profile/93623 * Makefile.in: Add _gcov_lock_unlock to LIBGCOV_INTERFACE. * libgcov-interface.c (ALIAS_void_fn): Remove. (__gcov_lock): New. diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c index a8054ed..855e861 100644 --- a/libgcc/libgcov-interface.c +++ b/libgcc/libgcov-interface.c @@ -197,17 +197,20 @@ __gcov_dump (void) #endif /* L_gcov_dump */ #ifdef L_gcov_fork -/* A wrapper for the fork function. Flushes the accumulated profiling data, so - that they are not counted twice. */ +/* A wrapper for the fork function. We reset counters in the child + so that they are not counted twice. */ pid_t __gcov_fork (void) { pid_t pid; - __gcov_flush (); pid = fork (); if (pid == 0) - __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx); + { + __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx); + /* We do not need locking as we are the only thread in the child. */ + __gcov_reset_int (); + } return pid; } #endif @@ -223,7 +226,8 @@ __gcov_execl (const char *path, char *arg, ...) unsigned i, length; char **args; - __gcov_flush (); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); va_start (ap, arg); va_copy (aq, ap); @@ -239,7 +243,10 @@ __gcov_execl (const char *path, char *arg, ...) args[i] = va_arg (aq, char *); va_end (aq); - return execv (path, args); + int ret = execv (path, args); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif @@ -254,7 +261,8 @@ __gcov_execlp (const char *path, char *arg, ...) unsigned i, length; char **args; - __gcov_flush (); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); va_start (ap, arg); va_copy (aq, ap); @@ -270,7 +278,10 @@ __gcov_execlp (const char *path, char *arg, ...) args[i] = va_arg (aq, char *); va_end (aq); - return execvp (path, args); + int ret = execvp (path, args); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif @@ -286,7 +297,8 @@ __gcov_execle (const char *path, char *arg, ...) char **args; char **envp; - __gcov_flush (); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); va_start (ap, arg); va_copy (aq, ap); @@ -303,7 +315,10 @@ __gcov_execle (const char *path, char *arg, ...) envp = va_arg (aq, char **); va_end (aq); - return execve (path, args, envp); + int ret = execve (path, args, envp); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif @@ -314,8 +329,12 @@ __gcov_execle (const char *path, char *arg, ...) int __gcov_execv (const char *path, char *const argv[]) { - __gcov_flush (); - return execv (path, argv); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); + int ret = execv (path, argv); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif @@ -326,8 +345,12 @@ __gcov_execv (const char *path, char *const argv[]) int __gcov_execvp (const char *path, char *const argv[]) { - __gcov_flush (); - return execvp (path, argv); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); + int ret = execvp (path, argv); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif @@ -338,8 +361,12 @@ __gcov_execvp (const char *path, char *const argv[]) int __gcov_execve (const char *path, char *const argv[], char *const envp[]) { - __gcov_flush (); - return execve (path, argv, envp); + /* Dump counters only, they will be lost after exec. */ + __gcov_dump (); + int ret = execve (path, argv, envp); + /* We reach this code only when execv fails, reset counter then here. */ + __gcov_reset (); + return ret; } #endif #endif /* inhibit_libc */ -- cgit v1.1 From 811b7636cb8c10f1a550a76242b5666c7ae36da2 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 5 May 2020 16:15:47 +0200 Subject: 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. --- libgcc/ChangeLog | 12 ++++++++++++ libgcc/Makefile.in | 2 +- libgcc/gcov.h | 5 ----- libgcc/libgcov-interface.c | 36 +++++++----------------------------- 4 files changed, 20 insertions(+), 35 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 6ef5eb9..cc6df8a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,6 +1,18 @@ 2020-05-05 Martin Liska 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 Martin Liska + + 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 diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index e6ed153..5c50f9f 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -904,7 +904,7 @@ LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_ior_profiler_atomic \ _gcov_indirect_call_profiler_v4 \ _gcov_time_profiler -LIBGCOV_INTERFACE = _gcov_dump _gcov_flush _gcov_fork \ +LIBGCOV_INTERFACE = _gcov_dump _gcov_fork \ _gcov_execl _gcov_execlp \ _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset \ _gcov_lock_unlock diff --git a/libgcc/gcov.h b/libgcc/gcov.h index f158191..0e3eed3 100644 --- a/libgcc/gcov.h +++ b/libgcc/gcov.h @@ -33,9 +33,4 @@ extern void __gcov_reset (void); extern void __gcov_dump (void); -/* Write profile information to a file and reset counters to zero. - The function does operations under a mutex. */ - -extern void __gcov_flush (void); - #endif /* GCC_GCOV_H */ diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c index 855e861..3a8a5bf 100644 --- a/libgcc/libgcov-interface.c +++ b/libgcc/libgcov-interface.c @@ -28,10 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined(inhibit_libc) -#ifdef L_gcov_flush -void __gcov_flush (void) {} -#endif - #ifdef L_gcov_reset void __gcov_reset (void) {} #endif @@ -42,19 +38,19 @@ void __gcov_dump (void) {} #else -extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; +extern __gthread_mutex_t __gcov_mx ATTRIBUTE_HIDDEN; #ifdef L_gcov_lock_unlock #ifdef __GTHREAD_MUTEX_INIT -__gthread_mutex_t __gcov_flush_mx = __GTHREAD_MUTEX_INIT; +__gthread_mutex_t __gcov_mx = __GTHREAD_MUTEX_INIT; #define init_mx_once() #else -__gthread_mutex_t __gcov_flush_mx; +__gthread_mutex_t __gcov_mx; static void init_mx (void) { - __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx); + __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_mx); } static void @@ -71,7 +67,7 @@ void __gcov_lock (void) { init_mx_once (); - __gthread_mutex_lock (&__gcov_flush_mx); + __gthread_mutex_lock (&__gcov_mx); } /* Unlock critical section for __gcov_dump and __gcov_reset functions. */ @@ -79,28 +75,10 @@ __gcov_lock (void) void __gcov_unlock (void) { - __gthread_mutex_unlock (&__gcov_flush_mx); + __gthread_mutex_unlock (&__gcov_mx); } #endif -#ifdef L_gcov_flush -/* Called before fork or exec - write out profile information gathered so - far and reset it to zero. This avoids duplication or loss of the - profile information gathered so far. */ - -void -__gcov_flush (void) -{ - __gcov_lock (); - - __gcov_dump_int (); - __gcov_reset_int (); - - __gcov_unlock (); -} - -#endif /* L_gcov_flush */ - #ifdef L_gcov_reset /* Reset all counters to zero. */ @@ -207,7 +185,7 @@ __gcov_fork (void) pid = fork (); if (pid == 0) { - __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx); + __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_mx); /* We do not need locking as we are the only thread in the child. */ __gcov_reset_int (); } -- cgit v1.1 From 438085cc66ed5801ea36c1027bbd624e86d8310f Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 12:24:18 -0400 Subject: setup branch --- libgcc/ChangeLog.meissner | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 libgcc/ChangeLog.meissner (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner new file mode 100644 index 0000000..98683f4 --- /dev/null +++ b/libgcc/ChangeLog.meissner @@ -0,0 +1,4 @@ +2020-05-05 Michael Meissner + + Clone branch + -- cgit v1.1 From 6034b9ca2428c073af950db3447bec785216ed05 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:31:03 -0400 Subject: Patch ieee128-lib-patch003b --- libgcc/ChangeLog.meissner | 7 +++++++ libgcc/config/rs6000/t-float128 | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner index 98683f4..54018d9 100644 --- a/libgcc/ChangeLog.meissner +++ b/libgcc/ChangeLog.meissner @@ -1,3 +1,10 @@ +2020-05-05 Michael Meissner + + (~/patches/ieee128-lib-patch003b) + PR target/94630 + * config/rs6000/t-float128 (ibm-ldouble$(objext)): Add the + -mno-gnu-attribute option. + 2020-05-05 Michael Meissner Clone branch diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index d541344..4d4e80c 100644 --- a/libgcc/config/rs6000/t-float128 +++ b/libgcc/config/rs6000/t-float128 @@ -69,6 +69,13 @@ $(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW) $(fp128_obj) : $(fp128_includes) $(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h + +# If we are switching the default long double type, we need to use +# -mno-gnu-attribute so that the __ibm128 support functions don't signal a +# linker error since the default long double is now IEEE 128-bit instead of IBM +# 128-bit. +ibm-ldouble$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute + $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep) @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \ echo "Create $@"; \ -- cgit v1.1 From 63f3d98b696d1dd96debd2ada3735a7f6ff586e4 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:35:40 -0400 Subject: Remove extra newline --- libgcc/ChangeLog.meissner | 1 - 1 file changed, 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner index 54018d9..9756721 100644 --- a/libgcc/ChangeLog.meissner +++ b/libgcc/ChangeLog.meissner @@ -8,4 +8,3 @@ 2020-05-05 Michael Meissner Clone branch - -- cgit v1.1 From 931ab4fd3348dd19b6bee6e9db170f27f1504dc9 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:36:17 -0400 Subject: Update ChangeLog --- libgcc/ChangeLog.meissner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner index 9756721..b76e585 100644 --- a/libgcc/ChangeLog.meissner +++ b/libgcc/ChangeLog.meissner @@ -1,6 +1,6 @@ 2020-05-05 Michael Meissner - (~/patches/ieee128-lib-patch003b) + (ieee128-lib-patch003b) PR target/94630 * config/rs6000/t-float128 (ibm-ldouble$(objext)): Add the -mno-gnu-attribute option. -- cgit v1.1 From 8e01d9d7904ffa782f5848f6856dc7b3345b7071 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:41:30 -0400 Subject: New files --- libgcc/config/rs6000/float128-decimal.c | 0 libgcc/config/rs6000/float128-decimal.ver | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 libgcc/config/rs6000/float128-decimal.c create mode 100644 libgcc/config/rs6000/float128-decimal.ver (limited to 'libgcc') diff --git a/libgcc/config/rs6000/float128-decimal.c b/libgcc/config/rs6000/float128-decimal.c new file mode 100644 index 0000000..e69de29 diff --git a/libgcc/config/rs6000/float128-decimal.ver b/libgcc/config/rs6000/float128-decimal.ver new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 03831dcc98977531001706792d9bdfc2cf9cca99 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:42:09 -0400 Subject: New file --- libgcc/config/rs6000/t-float128-decimal | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 libgcc/config/rs6000/t-float128-decimal (limited to 'libgcc') diff --git a/libgcc/config/rs6000/t-float128-decimal b/libgcc/config/rs6000/t-float128-decimal new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 3338afa4a3416f5d9a77c8d888f4a46052af186a Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 13:46:28 -0400 Subject: Patch ieee128-lib-patch010b --- libgcc/ChangeLog.meissner | 12 ++++ libgcc/config.host | 3 + libgcc/config/rs6000/float128-decimal.c | 78 +++++++++++++++++++++ libgcc/config/rs6000/float128-decimal.ver | 7 ++ libgcc/config/rs6000/t-float128-decimal | 7 ++ libgcc/configure | 108 +++++++++++++++++++++++++++++- libgcc/configure.ac | 46 ++++++++++++- 7 files changed, 259 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner index b76e585..2b8512e 100644 --- a/libgcc/ChangeLog.meissner +++ b/libgcc/ChangeLog.meissner @@ -1,5 +1,17 @@ 2020-05-05 Michael Meissner + (ieee128-lib-patch010b) + * config.host (powerpc*-*-linux): Add support if glibc does not + provide the appropriate IEEE 128-bit conversions to/from Decimal. + * config/rs6000/float128-decimal.c: New file. + * config/rs6000/float128-decimal.ver: New file. + * config/rs6000/t-float128-decimal: New file. + * configure.ac (powerpc*-*-linux): Add support if glibc does not + provide the appropriate IEEE 128-bit conversions to/from Decimal. + * configure: Regenerate. + +2020-05-05 Michael Meissner + (ieee128-lib-patch003b) PR target/94630 * config/rs6000/t-float128 (ibm-ldouble$(objext)): Add the diff --git a/libgcc/config.host b/libgcc/config.host index 1ff4159..7b48a3d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1220,6 +1220,9 @@ powerpc*-*-linux*) if test $libgcc_cv_powerpc_float128 = yes; then tmake_file="${tmake_file} rs6000/t-float128" + if test $libgcc_cv_powerpc_float128_dec = no; then + tmake_file="${tmake_file} rs6000/t-float128-decimal" + fi fi if test $libgcc_cv_powerpc_float128_hw = yes; then diff --git a/libgcc/config/rs6000/float128-decimal.c b/libgcc/config/rs6000/float128-decimal.c index e69de29..31af26b 100644 --- a/libgcc/config/rs6000/float128-decimal.c +++ b/libgcc/config/rs6000/float128-decimal.c @@ -0,0 +1,78 @@ +/* Provide missing conversions between IEEE 128-bit floating point and Decimal + floating point for PowerPC. + + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Michael Meissner (meissner@linux.ibm.com) + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +extern __float128 __dpd_trunctdkf (_Decimal128); +extern __float128 __dpd_truncddkf (_Decimal64); +extern __float128 __dpd_truncsdkf (_Decimal64); +extern _Decimal128 __dpd_extendkftd (__float128); +extern _Decimal64 __dpd_trunckfdd (__float128); +extern _Decimal32 __dpd_trunckfsd (__float128); + +__float128 +__dpd_trunctdkf (_Decimal128 x) +{ + __ibm128 ibm = (__ibm128) x; + return (__float128) ibm; +} + +__float128 +__dpd_truncddkf (_Decimal64 x) +{ + __ibm128 ibm = (__ibm128) x; + return (__float128) ibm; +} + +__float128 +__dpd_truncsdkf (_Decimal64 x) +{ + __ibm128 ibm = (__ibm128) x; + return (__float128) ibm; +} + +_Decimal128 +__dpd_extendkftd (__float128 x) +{ + __ibm128 ibm = (__ibm128) x; + return (_Decimal128) ibm; +} + +_Decimal64 +__dpd_trunckfdd (__float128 x) +{ + __ibm128 ibm = (__ibm128) x; + return (_Decimal64) ibm; +} + +_Decimal32 +__dpd_trunckfsd (__float128 x) +{ + __ibm128 ibm = (__ibm128) x; + return (_Decimal32) ibm; +} diff --git a/libgcc/config/rs6000/float128-decimal.ver b/libgcc/config/rs6000/float128-decimal.ver index e69de29..08c15e2 100644 --- a/libgcc/config/rs6000/float128-decimal.ver +++ b/libgcc/config/rs6000/float128-decimal.ver @@ -0,0 +1,7 @@ +GCC_10.0.0 { + # float128 <-> decimal conversions + __dpd_extendkftd + __dpd_trunckfdd + __dpd_trunckfsd + __dpd_trunctdkf +} diff --git a/libgcc/config/rs6000/t-float128-decimal b/libgcc/config/rs6000/t-float128-decimal index e69de29..2854c51 100644 --- a/libgcc/config/rs6000/t-float128-decimal +++ b/libgcc/config/rs6000/t-float128-decimal @@ -0,0 +1,7 @@ +# Add support for doing conversions between IEEE 128-bit floating point and +# Decimal types if glibc does not provide the necessary functions. + +LIB2ADD += $(srcdir)/config/rs6000/float128-decimal.c +SHLIB_MAPFILES += $(srcdir)/config/rs6000/float128-decimal.ver + +float128-decimal$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute diff --git a/libgcc/configure b/libgcc/configure index 26bf757..943086e 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -1801,6 +1801,52 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_preproc + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -5201,7 +5247,9 @@ case ${host} in # At present, we cannot turn -mfloat128 on via #pragma GCC target, so just # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if -# a new glibc is being used so that __builtin_cpu_supports can be used. +# a new glibc is being used so that __builtin_cpu_supports can be used. Check +# to see if glibc provides the necessary decimal <-> IEEE 128 function, and +# arrange to build our own version if they are not provided. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" @@ -5258,6 +5306,64 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128_hw" >&5 $as_echo "$libgcc_cv_powerpc_float128_hw" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC convert __float128 to/from _Decimal libraries" >&5 +$as_echo_n "checking for PowerPC convert __float128 to/from _Decimal libraries... " >&6; } +if ${libgcc_cv_powerpc_float128_dec+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + __attribute__((noinline)) __float128 f128_from_d128 (_Decimal128 d128) + { + return (__float128)d128; + } + __attribute__((noinline)) __float128 f128_from_d64 (_Decimal128 d64) + { + return (__float128)d64; + } + __attribute__((noinline)) __float128 f128_from_d32 (_Decimal128 d32) + { + return (__float128)d32; + } + __attribute__((noinline)) _Decimal128 d128_from_f128 (__float128 f128) + { + return (_Decimal128)f128; + } + __attribute__((noinline)) _Decimal64 d64_from_f128 (__float128 f128) + { + return (_Decimal64)f128; + } + __attribute__((noinline)) _Decimal32 d32_from_f128 (__float128 f128) + { + return (_Decimal32)f128; + } + int main (void) + { + __float128 five = 5.0; + if (f128_from_d128 (5.0dl) != five + || f128_from_d64 (5.0dd) != five + || f128_from_d32 (5.0df) != five + || d128_from_f128 (five) != 5.0dl + || d64_from_f128 (five) != 5.0dd + || d32_from_f128 (five) != 5.0df) + abort (); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + libgcc_cv_powerpc_float128_dec=yes +else + libgcc_cv_powerpc_float128_dec=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128_dec" >&5 +$as_echo "$libgcc_cv_powerpc_float128_dec" >&6; } CFLAGS="$saved_CFLAGS" esac diff --git a/libgcc/configure.ac b/libgcc/configure.ac index bff6e54..4aa03a4 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -424,7 +424,9 @@ case ${host} in # At present, we cannot turn -mfloat128 on via #pragma GCC target, so just # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if -# a new glibc is being used so that __builtin_cpu_supports can be used. +# a new glibc is being used so that __builtin_cpu_supports can be used. Check +# to see if glibc provides the necessary decimal <-> IEEE 128 function, and +# arrange to build our own version if they are not provided. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" @@ -457,6 +459,48 @@ powerpc*-*-linux*) __attribute__ ((__ifunc__ ("add_resolver")));])], [libgcc_cv_powerpc_float128_hw=yes], [libgcc_cv_powerpc_float128_hw=no])]) + AC_CACHE_CHECK([for PowerPC convert __float128 to/from _Decimal libraries], + [libgcc_cv_powerpc_float128_dec], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([#include + __attribute__((noinline)) __float128 f128_from_d128 (_Decimal128 d128) + { + return (__float128)d128; + } + __attribute__((noinline)) __float128 f128_from_d64 (_Decimal128 d64) + { + return (__float128)d64; + } + __attribute__((noinline)) __float128 f128_from_d32 (_Decimal128 d32) + { + return (__float128)d32; + } + __attribute__((noinline)) _Decimal128 d128_from_f128 (__float128 f128) + { + return (_Decimal128)f128; + } + __attribute__((noinline)) _Decimal64 d64_from_f128 (__float128 f128) + { + return (_Decimal64)f128; + } + __attribute__((noinline)) _Decimal32 d32_from_f128 (__float128 f128) + { + return (_Decimal32)f128; + } + int main (void) + { + __float128 five = 5.0; + if (f128_from_d128 (5.0dl) != five + || f128_from_d64 (5.0dd) != five + || f128_from_d32 (5.0df) != five + || d128_from_f128 (five) != 5.0dl + || d64_from_f128 (five) != 5.0dd + || d32_from_f128 (five) != 5.0df) + abort (); + return 0; + }])], + [libgcc_cv_powerpc_float128_dec=yes], + [libgcc_cv_powerpc_float128_dec=no])]) CFLAGS="$saved_CFLAGS" esac -- cgit v1.1 From ef836167f594c4657404e16e7fd18196348f8582 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 14:01:48 -0400 Subject: Delete changes meant for a private branch. 2020-05-05 Michael Meissner * 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 * gcc.dg/nextafter-2.c: Delete changes meant for a private branch. * gcc.target/powerpc/pr70117.c: Likewise. 2020-05-05 Michael Meissner * config.host: Delete changes meant for a private branch. * config/rs6000/t-float128: Likewise. * configure.ac: Likewise. * configure: Likewise. --- libgcc/ChangeLog | 7 +++ libgcc/config.host | 3 -- libgcc/config/rs6000/t-float128 | 7 --- libgcc/configure | 108 +--------------------------------------- libgcc/configure.ac | 46 +---------------- 5 files changed, 9 insertions(+), 162 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index cc6df8a..49d757f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2020-05-05 Michael Meissner + + * config.host: Delete changes meant for a private branch. + * config/rs6000/t-float128: Likewise. + * configure.ac: Likewise. + * configure: Likewise. + 2020-05-05 Martin Liska PR gcov-profile/93623 diff --git a/libgcc/config.host b/libgcc/config.host index 7b48a3d..1ff4159 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1220,9 +1220,6 @@ powerpc*-*-linux*) if test $libgcc_cv_powerpc_float128 = yes; then tmake_file="${tmake_file} rs6000/t-float128" - if test $libgcc_cv_powerpc_float128_dec = no; then - tmake_file="${tmake_file} rs6000/t-float128-decimal" - fi fi if test $libgcc_cv_powerpc_float128_hw = yes; then diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index 4d4e80c..d541344 100644 --- a/libgcc/config/rs6000/t-float128 +++ b/libgcc/config/rs6000/t-float128 @@ -69,13 +69,6 @@ $(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW) $(fp128_obj) : $(fp128_includes) $(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h - -# If we are switching the default long double type, we need to use -# -mno-gnu-attribute so that the __ibm128 support functions don't signal a -# linker error since the default long double is now IEEE 128-bit instead of IBM -# 128-bit. -ibm-ldouble$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute - $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep) @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \ echo "Create $@"; \ diff --git a/libgcc/configure b/libgcc/configure index 943086e..26bf757 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -1801,52 +1801,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_preproc - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -5247,9 +5201,7 @@ case ${host} in # At present, we cannot turn -mfloat128 on via #pragma GCC target, so just # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if -# a new glibc is being used so that __builtin_cpu_supports can be used. Check -# to see if glibc provides the necessary decimal <-> IEEE 128 function, and -# arrange to build our own version if they are not provided. +# a new glibc is being used so that __builtin_cpu_supports can be used. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" @@ -5306,64 +5258,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128_hw" >&5 $as_echo "$libgcc_cv_powerpc_float128_hw" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC convert __float128 to/from _Decimal libraries" >&5 -$as_echo_n "checking for PowerPC convert __float128 to/from _Decimal libraries... " >&6; } -if ${libgcc_cv_powerpc_float128_dec+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - __attribute__((noinline)) __float128 f128_from_d128 (_Decimal128 d128) - { - return (__float128)d128; - } - __attribute__((noinline)) __float128 f128_from_d64 (_Decimal128 d64) - { - return (__float128)d64; - } - __attribute__((noinline)) __float128 f128_from_d32 (_Decimal128 d32) - { - return (__float128)d32; - } - __attribute__((noinline)) _Decimal128 d128_from_f128 (__float128 f128) - { - return (_Decimal128)f128; - } - __attribute__((noinline)) _Decimal64 d64_from_f128 (__float128 f128) - { - return (_Decimal64)f128; - } - __attribute__((noinline)) _Decimal32 d32_from_f128 (__float128 f128) - { - return (_Decimal32)f128; - } - int main (void) - { - __float128 five = 5.0; - if (f128_from_d128 (5.0dl) != five - || f128_from_d64 (5.0dd) != five - || f128_from_d32 (5.0df) != five - || d128_from_f128 (five) != 5.0dl - || d64_from_f128 (five) != 5.0dd - || d32_from_f128 (five) != 5.0df) - abort (); - return 0; - } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - libgcc_cv_powerpc_float128_dec=yes -else - libgcc_cv_powerpc_float128_dec=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128_dec" >&5 -$as_echo "$libgcc_cv_powerpc_float128_dec" >&6; } CFLAGS="$saved_CFLAGS" esac diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 4aa03a4..bff6e54 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -424,9 +424,7 @@ case ${host} in # At present, we cannot turn -mfloat128 on via #pragma GCC target, so just # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if -# a new glibc is being used so that __builtin_cpu_supports can be used. Check -# to see if glibc provides the necessary decimal <-> IEEE 128 function, and -# arrange to build our own version if they are not provided. +# a new glibc is being used so that __builtin_cpu_supports can be used. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" @@ -459,48 +457,6 @@ powerpc*-*-linux*) __attribute__ ((__ifunc__ ("add_resolver")));])], [libgcc_cv_powerpc_float128_hw=yes], [libgcc_cv_powerpc_float128_hw=no])]) - AC_CACHE_CHECK([for PowerPC convert __float128 to/from _Decimal libraries], - [libgcc_cv_powerpc_float128_dec], - [AC_LINK_IFELSE( - [AC_LANG_SOURCE([#include - __attribute__((noinline)) __float128 f128_from_d128 (_Decimal128 d128) - { - return (__float128)d128; - } - __attribute__((noinline)) __float128 f128_from_d64 (_Decimal128 d64) - { - return (__float128)d64; - } - __attribute__((noinline)) __float128 f128_from_d32 (_Decimal128 d32) - { - return (__float128)d32; - } - __attribute__((noinline)) _Decimal128 d128_from_f128 (__float128 f128) - { - return (_Decimal128)f128; - } - __attribute__((noinline)) _Decimal64 d64_from_f128 (__float128 f128) - { - return (_Decimal64)f128; - } - __attribute__((noinline)) _Decimal32 d32_from_f128 (__float128 f128) - { - return (_Decimal32)f128; - } - int main (void) - { - __float128 five = 5.0; - if (f128_from_d128 (5.0dl) != five - || f128_from_d64 (5.0dd) != five - || f128_from_d32 (5.0df) != five - || d128_from_f128 (five) != 5.0dl - || d64_from_f128 (five) != 5.0dd - || d32_from_f128 (five) != 5.0df) - abort (); - return 0; - }])], - [libgcc_cv_powerpc_float128_dec=yes], - [libgcc_cv_powerpc_float128_dec=no])]) CFLAGS="$saved_CFLAGS" esac -- cgit v1.1 From d236b30c5cd988b3e7016702d143f9e20ce10463 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 14:04:59 -0400 Subject: Remove files meant for private branch --- libgcc/config/rs6000/float128-decimal.c | 78 ------------------------------- libgcc/config/rs6000/float128-decimal.ver | 7 --- 2 files changed, 85 deletions(-) delete mode 100644 libgcc/config/rs6000/float128-decimal.c delete mode 100644 libgcc/config/rs6000/float128-decimal.ver (limited to 'libgcc') diff --git a/libgcc/config/rs6000/float128-decimal.c b/libgcc/config/rs6000/float128-decimal.c deleted file mode 100644 index 31af26b..0000000 --- a/libgcc/config/rs6000/float128-decimal.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Provide missing conversions between IEEE 128-bit floating point and Decimal - floating point for PowerPC. - - Copyright (C) 2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Michael Meissner (meissner@linux.ibm.com) - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file into - combinations with other programs, and to distribute those - combinations without any restriction coming from the use of this - file. (The Lesser General Public License restrictions do apply in - other respects; for example, they cover modification of the file, - and distribution when not linked into a combine executable.) - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -extern __float128 __dpd_trunctdkf (_Decimal128); -extern __float128 __dpd_truncddkf (_Decimal64); -extern __float128 __dpd_truncsdkf (_Decimal64); -extern _Decimal128 __dpd_extendkftd (__float128); -extern _Decimal64 __dpd_trunckfdd (__float128); -extern _Decimal32 __dpd_trunckfsd (__float128); - -__float128 -__dpd_trunctdkf (_Decimal128 x) -{ - __ibm128 ibm = (__ibm128) x; - return (__float128) ibm; -} - -__float128 -__dpd_truncddkf (_Decimal64 x) -{ - __ibm128 ibm = (__ibm128) x; - return (__float128) ibm; -} - -__float128 -__dpd_truncsdkf (_Decimal64 x) -{ - __ibm128 ibm = (__ibm128) x; - return (__float128) ibm; -} - -_Decimal128 -__dpd_extendkftd (__float128 x) -{ - __ibm128 ibm = (__ibm128) x; - return (_Decimal128) ibm; -} - -_Decimal64 -__dpd_trunckfdd (__float128 x) -{ - __ibm128 ibm = (__ibm128) x; - return (_Decimal64) ibm; -} - -_Decimal32 -__dpd_trunckfsd (__float128 x) -{ - __ibm128 ibm = (__ibm128) x; - return (_Decimal32) ibm; -} diff --git a/libgcc/config/rs6000/float128-decimal.ver b/libgcc/config/rs6000/float128-decimal.ver deleted file mode 100644 index 08c15e2..0000000 --- a/libgcc/config/rs6000/float128-decimal.ver +++ /dev/null @@ -1,7 +0,0 @@ -GCC_10.0.0 { - # float128 <-> decimal conversions - __dpd_extendkftd - __dpd_trunckfdd - __dpd_trunckfsd - __dpd_trunctdkf -} -- cgit v1.1 From 35a4fe9dcf80774e390cdcbf162454842fe28334 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 14:07:02 -0400 Subject: Delete file meant for private branch --- libgcc/ChangeLog.meissner | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 libgcc/ChangeLog.meissner (limited to 'libgcc') diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner deleted file mode 100644 index 2b8512e..0000000 --- a/libgcc/ChangeLog.meissner +++ /dev/null @@ -1,22 +0,0 @@ -2020-05-05 Michael Meissner - - (ieee128-lib-patch010b) - * config.host (powerpc*-*-linux): Add support if glibc does not - provide the appropriate IEEE 128-bit conversions to/from Decimal. - * config/rs6000/float128-decimal.c: New file. - * config/rs6000/float128-decimal.ver: New file. - * config/rs6000/t-float128-decimal: New file. - * configure.ac (powerpc*-*-linux): Add support if glibc does not - provide the appropriate IEEE 128-bit conversions to/from Decimal. - * configure: Regenerate. - -2020-05-05 Michael Meissner - - (ieee128-lib-patch003b) - PR target/94630 - * config/rs6000/t-float128 (ibm-ldouble$(objext)): Add the - -mno-gnu-attribute option. - -2020-05-05 Michael Meissner - - Clone branch -- cgit v1.1 From e5185cc6be3da99435129cdc0c769d4081e82989 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 5 May 2020 14:08:33 -0400 Subject: Delete file meant for a private branch --- libgcc/config/rs6000/t-float128-decimal | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 libgcc/config/rs6000/t-float128-decimal (limited to 'libgcc') diff --git a/libgcc/config/rs6000/t-float128-decimal b/libgcc/config/rs6000/t-float128-decimal deleted file mode 100644 index 2854c51..0000000 --- a/libgcc/config/rs6000/t-float128-decimal +++ /dev/null @@ -1,7 +0,0 @@ -# Add support for doing conversions between IEEE 128-bit floating point and -# Decimal types if glibc does not provide the necessary functions. - -LIB2ADD += $(srcdir)/config/rs6000/float128-decimal.c -SHLIB_MAPFILES += $(srcdir)/config/rs6000/float128-decimal.ver - -float128-decimal$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute -- cgit v1.1 From 1266778548e20de82983b6446f3cb685068cfb1e Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Wed, 6 May 2020 16:20:38 +0100 Subject: [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 * 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__. --- libgcc/ChangeLog | 8 ++++++++ libgcc/config/aarch64/lse-init.c | 17 +++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 49d757f..8e63e43 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2020-05-06 Kyrylo Tkachov + + * 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-05 Michael Meissner * config.host: Delete changes meant for a private branch. diff --git a/libgcc/config/aarch64/lse-init.c b/libgcc/config/aarch64/lse-init.c index 74acef2..00e9ab8 100644 --- a/libgcc/config/aarch64/lse-init.c +++ b/libgcc/config/aarch64/lse-init.c @@ -29,19 +29,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see _Bool __aarch64_have_lse_atomics __attribute__((visibility("hidden"), nocommon)); -/* Disable initialization of __aarch64_have_lse_atomics during bootstrap. */ -#if !defined(inhibit_libc) && defined(HAVE_SYS_AUXV_H) -# include +/* Gate availability of __getauxval on glibc. All AArch64-supporting glibc + versions support it. */ +#ifdef __gnu_linux__ -/* Disable initialization if the system headers are too old. */ -# if defined(AT_HWCAP) && defined(HWCAP_ATOMICS) +# define AT_HWCAP 16 +# define HWCAP_ATOMICS (1 << 8) + +unsigned long int __getauxval (unsigned long int); static void __attribute__((constructor)) init_have_lse_atomics (void) { - unsigned long hwcap = getauxval (AT_HWCAP); + unsigned long hwcap = __getauxval (AT_HWCAP); __aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0; } -# endif /* HWCAP */ -#endif /* inhibit_libc */ +#endif /* __gnu_linux__ */ -- cgit v1.1 From d3a1459cd4f2d4997fb53e34ddef72e91a7855c1 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 6 May 2020 23:01:32 +0200 Subject: 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. --- libgcc/ChangeLog | 10 +++++++++- libgcc/config/i386/sfp-exceptions.c | 22 +++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 8e63e43..33e8929 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2020-05-06 Uroš Bizjak + + * 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. + 2020-05-06 Kyrylo Tkachov * config/aarch64/lse-init.c (init_have_lse_atomics): Use __getauxval @@ -54,7 +62,7 @@ 2020-05-01 Uroš Bizjak * config/i386/sfp-exceptions.c (__math_force_eval): New define. - (__sfp_handle_exceptions): Use __math_force_eval to evaluete + (__sfp_handle_exceptions): Use __math_force_eval to evaluate generic division to generate INVALID and DIVZERO exceptions. 2020-04-27 Sebastian Huber diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index 4b3a7a0..72cb0f4 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -42,22 +42,25 @@ struct fenv }; #ifdef __SSE_MATH__ -# define __math_force_eval(x) asm volatile ("" : : "x" (x)); +# define __math_force_eval_div(x, y) \ + do { asm ("" : "+x" (x)); asm volatile ("" : : "x" (x / y)); } while (0) #else -# define __math_force_eval(x) asm volatile ("" : : "f" (x)); +# define __math_force_eval_div(x, y) \ + do { asm ("" : "+t" (x)); asm volatile ("" : : "f" (x / y)); } while (0) #endif void __sfp_handle_exceptions (int _fex) { + struct fenv temp; + if (_fex & FP_EX_INVALID) { float f = 0.0f; - __math_force_eval (f / f); + __math_force_eval_div (f, f); } if (_fex & FP_EX_DENORM) { - struct fenv temp; asm volatile ("fnstenv\t%0" : "=m" (temp)); temp.__status_word |= FP_EX_DENORM; asm volatile ("fldenv\t%0" : : "m" (temp)); @@ -66,11 +69,10 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_DIVZERO) { float f = 1.0f, g = 0.0f; - __math_force_eval (f / g); + __math_force_eval_div (f, g); } if (_fex & FP_EX_OVERFLOW) { - struct fenv temp; asm volatile ("fnstenv\t%0" : "=m" (temp)); temp.__status_word |= FP_EX_OVERFLOW; asm volatile ("fldenv\t%0" : : "m" (temp)); @@ -78,7 +80,6 @@ __sfp_handle_exceptions (int _fex) } if (_fex & FP_EX_UNDERFLOW) { - struct fenv temp; asm volatile ("fnstenv\t%0" : "=m" (temp)); temp.__status_word |= FP_EX_UNDERFLOW; asm volatile ("fldenv\t%0" : : "m" (temp)); @@ -87,12 +88,7 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_INEXACT) { float f = 1.0f, g = 3.0f; -#ifdef __SSE_MATH__ - asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); -#else - asm volatile ("fdivs\t%1" : "+t" (f) : "m" (g)); - /* No need for fwait, exception is triggered by emitted fstp. */ -#endif + __math_force_eval_div (f, g); } } #endif -- cgit v1.1 From 39748a89976d0fd0f75bda58fbae033b45df8c2f Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Wed, 22 Jan 2020 05:44:32 +0100 Subject: 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. --- libgcc/ChangeLog | 5 +++++ libgcc/config.host | 9 --------- libgcc/config/cris/libgcc-glibc.ver | 7 ------- libgcc/config/cris/t-linux | 2 -- 4 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 libgcc/config/cris/libgcc-glibc.ver delete mode 100644 libgcc/config/cris/t-linux (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 33e8929..8ae4c7f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-09 Hans-Peter Nilsson + + * config.host: Remove support for crisv32-*-* and cris*-*-linux. + * config/cris/libgcc-glibc.ver, config/cris/t-linux: Remove. + 2020-05-06 Uroš Bizjak * config/i386/sfp-exceptions.c (__math_force_eval): Remove. diff --git a/libgcc/config.host b/libgcc/config.host index 1ff4159..2cd4209 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -112,9 +112,6 @@ bpf-*-*) ;; cr16-*-*) ;; -crisv32-*-*) - cpu_type=cris - ;; csky*-*-*) cpu_type=csky ;; @@ -577,15 +574,9 @@ cr16-*-elf) tmake_file="${tmake_file} cr16/t-cr16 cr16/t-crtlibid t-fdpbit" extra_parts="$extra_parts crti.o crtn.o crtlibid.o" ;; -crisv32-*-elf) - tmake_file="$tmake_file cris/t-cris t-softfp-sfdf t-softfp" - ;; cris-*-elf) tmake_file="$tmake_file cris/t-cris t-softfp-sfdf t-softfp cris/t-elfmulti" ;; -cris-*-linux* | crisv32-*-linux*) - tmake_file="$tmake_file cris/t-cris t-softfp-sfdf t-softfp cris/t-linux" - ;; csky-*-elf*) tmake_file="csky/t-csky t-fdpbit" extra_parts="$extra_parts crti.o crtn.o" diff --git a/libgcc/config/cris/libgcc-glibc.ver b/libgcc/config/cris/libgcc-glibc.ver deleted file mode 100644 index e35de83..0000000 --- a/libgcc/config/cris/libgcc-glibc.ver +++ /dev/null @@ -1,7 +0,0 @@ -GCC_4.3 { - __Mul - __Div - __Udiv - __Mod - __Umod -} diff --git a/libgcc/config/cris/t-linux b/libgcc/config/cris/t-linux deleted file mode 100644 index 8c7f4d4..0000000 --- a/libgcc/config/cris/t-linux +++ /dev/null @@ -1,2 +0,0 @@ -# Override t-linux default. -SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/cris/libgcc-glibc.ver -- cgit v1.1 From 8d286dd118a5bd16f7ae0fb9dfcdcfd020bea803 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 14 May 2020 08:25:39 -0700 Subject: 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. --- libgcc/ChangeLog | 4 ++++ libgcc/configure | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 8ae4c7f..b0a432f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2020-05-14 H.J. Lu + + * configure: Regenerated. + 2020-05-09 Hans-Peter Nilsson * config.host: Remove support for crisv32-*-* and cris*-*-linux. diff --git a/libgcc/configure b/libgcc/configure index 26bf757..a5d5ab8 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -1353,7 +1353,7 @@ Optional Features: enable decimal float extension to C. Selecting 'bid' or 'dpd' choses which decimal floating point format to use - --enable-cet enable Intel CET in target libraries [default=no] + --enable-cet enable Intel CET in target libraries [default=auto] --enable-explicit-exception-frame-registration register exception tables explicitly at module start, for use e.g. for compatibility with @@ -4900,7 +4900,7 @@ if test "${enable_cet+set}" = set; then : esac else - enable_cet=no + enable_cet=auto fi -- cgit v1.1 From 4c1a5d8b71e29b71e0bc1004480c12c5fc427cb7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 15 May 2020 09:06:50 -0700 Subject: 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. --- libgcc/ChangeLog | 5 +++++ libgcc/configure | 3 +++ 2 files changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b0a432f..7343c77 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libgcc/configure b/libgcc/configure index a5d5ab8..5d0c79b 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -4913,6 +4913,8 @@ case "$host" in auto) # Check if target supports multi-byte NOPs # and if assembler supports CET insn. + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fcf-protection" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4936,6 +4938,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. -- cgit v1.1 From 453954451be68d22462442268a29f54809182d2b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 19 May 2020 14:42:12 -0700 Subject: 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. --- libgcc/ChangeLog | 9 +++++++++ libgcc/config/i386/cpuinfo.c | 6 ++++-- libgcc/config/i386/cpuinfo.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7343c77..64c3bb1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2020-05-19 H.J. Lu + + 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-15 H.J. Lu PR bootstrap/95147 diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 00322c5..26c1bdc 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -349,6 +349,8 @@ get_available_features (unsigned int ecx, unsigned int edx, } if (ebx & bit_BMI2) set_feature (FEATURE_BMI2); + if (ecx & bit_GFNI) + set_feature (FEATURE_GFNI); if (avx512_usable) { if (ebx & bit_AVX512F) @@ -371,8 +373,6 @@ get_available_features (unsigned int ecx, unsigned int edx, set_feature (FEATURE_AVX512VBMI); if (ecx & bit_AVX512VBMI2) set_feature (FEATURE_AVX512VBMI2); - if (ecx & bit_GFNI) - set_feature (FEATURE_GFNI); if (ecx & bit_VPCLMULQDQ) set_feature (FEATURE_VPCLMULQDQ); if (ecx & bit_AVX512VNNI) @@ -385,6 +385,8 @@ get_available_features (unsigned int ecx, unsigned int edx, set_feature (FEATURE_AVX5124VNNIW); if (edx & bit_AVX5124FMAPS) set_feature (FEATURE_AVX5124FMAPS); + if (edx & bit_AVX512VP2INTERSECT) + set_feature (FEATURE_AVX512VP2INTERSECT); __cpuid_count (7, 1, eax, ebx, ecx, edx); if (eax & bit_AVX512BF16) diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index 41c4a49..fd6d12a 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -122,6 +122,7 @@ enum processor_features FEATURE_VPCLMULQDQ, FEATURE_AVX512VNNI, FEATURE_AVX512BITALG, + FEATURE_AVX512VP2INTERSECT, FEATURE_AVX512BF16 }; -- cgit v1.1 From 1e46a443f25d26816536c0c480211714b123a1d5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 19 May 2020 18:55:08 -0700 Subject: 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. --- libgcc/config/i386/cpuinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 26c1bdc..cf5f088 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -346,6 +346,8 @@ get_available_features (unsigned int ecx, unsigned int edx, { if (ebx & bit_AVX2) set_feature (FEATURE_AVX2); + if (ecx & bit_VPCLMULQDQ) + set_feature (FEATURE_VPCLMULQDQ); } if (ebx & bit_BMI2) set_feature (FEATURE_BMI2); @@ -373,8 +375,6 @@ get_available_features (unsigned int ecx, unsigned int edx, set_feature (FEATURE_AVX512VBMI); if (ecx & bit_AVX512VBMI2) set_feature (FEATURE_AVX512VBMI2); - if (ecx & bit_VPCLMULQDQ) - set_feature (FEATURE_VPCLMULQDQ); if (ecx & bit_AVX512VNNI) set_feature (FEATURE_AVX512VNNI); if (ecx & bit_AVX512BITALG) -- cgit v1.1 From 35b980365c9230c1d704e561e1d4a8e0e69d2a82 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 20 May 2020 04:23:38 -0700 Subject: Add missing ChangeLog entry for r11-516 --- libgcc/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 64c3bb1..9f359ca 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-05-20 H.J. Lu + + PR target/91695 + * config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ + check. + 2020-05-19 H.J. Lu PR target/95212 -- cgit v1.1 From 5855bdfa06fb25c0880af89cb2bfdcdf342beac2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 21 May 2020 05:32:53 -0700 Subject: 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. --- libgcc/ChangeLog | 6 ++++++ libgcc/config/i386/cpuinfo.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 9f359ca..ca729c4 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-05-21 H.J. Lu + + PR target/95212 + * config/i386/cpuinfo.h (processor_features): Move + FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16. + 2020-05-20 H.J. Lu PR target/91695 diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index fd6d12a..0f97510 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -122,8 +122,8 @@ enum processor_features FEATURE_VPCLMULQDQ, FEATURE_AVX512VNNI, FEATURE_AVX512BITALG, - FEATURE_AVX512VP2INTERSECT, - FEATURE_AVX512BF16 + FEATURE_AVX512BF16, + FEATURE_AVX512VP2INTERSECT }; extern struct __processor_model -- cgit v1.1 From 17d1594bfe08f3c768e024b180816cbe37ac08ac Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 28 May 2020 08:16:58 +0200 Subject: gcov-tool: Flexible endian adjustment for merging coverage data gcc/ChangeLog: 2020-05-27 Dong JianQiang 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 PR gcov-profile/95332 * libgcov-util.c (read_gcda_file): Call gcov_magic. * libgcov.h (gcov_magic): Disable GCC poison. --- libgcc/libgcov-util.c | 5 ++--- libgcc/libgcov.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 449638b..fff54c6 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -261,7 +261,7 @@ read_gcda_file (const char *filename) { unsigned tags[4]; unsigned depth = 0; - unsigned magic, version; + unsigned version; struct gcov_info *obj_info; int i; @@ -276,8 +276,7 @@ read_gcda_file (const char *filename) } /* Read magic. */ - magic = gcov_read_unsigned (); - if (magic != GCOV_DATA_MAGIC) + if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC)) { fnotice (stderr, "%s:not a gcov data file\n", filename); gcov_close (); diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 104b80b..b248690 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -147,7 +147,7 @@ extern struct gcov_info *gcov_list; /* Poison these, so they don't accidentally slip in. */ #pragma GCC poison gcov_write_string gcov_write_tag gcov_write_length -#pragma GCC poison gcov_time gcov_magic +#pragma GCC poison gcov_time #ifdef HAVE_GAS_HIDDEN #define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden"))) -- cgit v1.1 From 53ffb43a79780b6e33e1816831724c0fb3d2fa32 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 29 May 2020 00:16:23 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index ca729c4..06e7986 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-05-28 Dong JianQiang + + PR gcov-profile/95332 + * libgcov-util.c (read_gcda_file): Call gcov_magic. + * libgcov.h (gcov_magic): Disable GCC poison. + 2020-05-21 H.J. Lu PR target/95212 -- cgit v1.1 From 9051b548274bffef9f41e720e1894d12cf68a47c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 29 May 2020 12:23:33 -0700 Subject: 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. --- libgcc/configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/configure b/libgcc/configure index 5d0c79b..13548ca 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -4907,13 +4907,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CET support" >&5 $as_echo_n "checking for CET support... " >&6; } +# NB: Avoid nested save_CFLAGS and save_LDFLAGS. case "$host" in i[34567]86-*-linux* | x86_64-*-linux*) case "$enable_cet" in auto) # Check if target supports multi-byte NOPs # and if assembler supports CET insn. - save_CFLAGS="$CFLAGS" + cet_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fcf-protection" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4938,7 +4939,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$save_CFLAGS" + CFLAGS="$cet_save_CFLAGS" ;; yes) # Check if assembler supports CET. -- cgit v1.1 From 885ef72f270cf8e58066681e70fb05d846ac426e Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 30 May 2020 00:16:27 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 06e7986..81ff41f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-29 H.J. Lu + + PR bootstrap/95413 + * configure: Regenerated. + 2020-05-28 Dong JianQiang PR gcov-profile/95332 -- cgit v1.1 From 832c1192eba6dd100e2f757e30ea6373f782ff55 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 1 Jun 2020 22:23:51 +0200 Subject: i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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)). --- libgcc/config/i386/sfp-exceptions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index 72cb0f4..3aed0af 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -39,7 +39,7 @@ struct fenv unsigned int __data_offset; unsigned short int __data_selector; unsigned short int __unused5; -}; +} __attribute__ ((gcc_struct)); #ifdef __SSE_MATH__ # define __math_force_eval_div(x, y) \ -- cgit v1.1 From 4a9aa9dec7fc413654807890061a4d7df8a1c5e7 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 2 Jun 2020 00:16:25 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 81ff41f..e39bd90 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-06-01 Uroš Bizjak + + * config/i386/sfp-exceptions.c (struct fenv): + Add __attribute__ ((gcc_struct)). + 2020-05-29 H.J. Lu PR bootstrap/95413 -- cgit v1.1 From 871e5ada6d53d5eb495cc9f323983f347487c1b2 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 31 Jan 2020 13:10:14 +0100 Subject: 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. --- libgcc/libgcov-driver.c | 116 +++++++++++++++++++++------------------------- libgcc/libgcov-merge.c | 103 ++++++++-------------------------------- libgcc/libgcov-profiler.c | 40 +--------------- libgcc/libgcov.h | 87 ++++++++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+), 184 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index fb32073..8348d9f 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -213,51 +213,6 @@ static struct gcov_fn_buffer *fn_buffer; /* Including system dependent components. */ #include "libgcov-driver-system.c" -/* Prune TOP N value COUNTERS. It's needed in order to preserve - reproducibility of builds. */ - -static void -prune_topn_counter (gcov_type *counters, gcov_type all) -{ - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - if (counters[2 * i + 1] < all) - { - counters[2 * i] = 0; - counters[2 * i + 1] = 0; - } -} - -/* Prune counters so that they are ready to store or merge. */ - -static void -prune_counters (struct gcov_info *gi) -{ - for (unsigned i = 0; i < gi->n_functions; i++) - { - const struct gcov_fn_info *gfi = gi->functions[i]; - const struct gcov_ctr_info *ci = gfi->ctrs; - - for (unsigned j = 0; j < GCOV_COUNTERS; j++) - { - if (gi->merge[j] == NULL) - continue; - - if (gi->merge[j] == __gcov_merge_topn) - { - gcc_assert (!(ci->num % GCOV_TOPN_VALUES_COUNTERS)); - for (unsigned k = 0; k < (ci->num / GCOV_TOPN_VALUES_COUNTERS); - k++) - { - gcov_type *counters - = ci->values + (k * GCOV_TOPN_VALUES_COUNTERS); - prune_topn_counter (counters + 1, *counters); - } - } - ci++; - } - } -} - /* This function merges counters in GI_PTR to an existing gcda file. Return 0 on success. Return -1 on error. In this case, caller will goto read_fatal. */ @@ -346,16 +301,18 @@ merge_one_data (const char *filename, if (!merge) continue; - tag = gcov_read_unsigned (); - length = gcov_read_unsigned (); - if (tag != GCOV_TAG_FOR_COUNTER (t_ix) - || length != GCOV_TAG_COUNTER_LENGTH (ci_ptr->num)) - goto read_mismatch; - (*merge) (ci_ptr->values, ci_ptr->num); - ci_ptr++; - } + tag = gcov_read_unsigned (); + length = gcov_read_unsigned (); + if (tag != GCOV_TAG_FOR_COUNTER (t_ix) + || (length != GCOV_TAG_COUNTER_LENGTH (ci_ptr->num) + && t_ix != GCOV_COUNTER_V_TOPN + && t_ix != GCOV_COUNTER_V_INDIR)) + goto read_mismatch; + (*merge) (ci_ptr->values, ci_ptr->num); + ci_ptr++; + } if ((error = gcov_is_error ())) - goto read_error; + goto read_error; } if (tag) @@ -374,6 +331,37 @@ read_error: return -1; } +/* Store all TOP N counters where each has a dynamic length. */ + +static void +write_top_counters (const struct gcov_ctr_info *ci_ptr, + unsigned t_ix, + gcov_unsigned_t n_counts) +{ + unsigned counters = n_counts / GCOV_TOPN_MEM_COUNTERS; + gcc_assert (n_counts % GCOV_TOPN_MEM_COUNTERS == 0); + unsigned pair_total = 0; + for (unsigned i = 0; i < counters; i++) + pair_total += ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 1]; + unsigned disk_size = GCOV_TOPN_DISK_COUNTERS * counters + 2 * pair_total; + gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), + GCOV_TAG_COUNTER_LENGTH (disk_size)); + + for (unsigned i = 0; i < counters; i++) + { + gcov_type pair_count = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 1]; + gcov_write_counter (ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i]); + gcov_write_counter (pair_count); + for (struct gcov_kvp *node + = (struct gcov_kvp *)ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2]; + node != NULL; node = node->next) + { + gcov_write_counter (node->value); + gcov_write_counter (node->count); + } + } +} + /* Write counters in GI_PTR and the summary in PRG to a gcda file. In the case of appending to an existing file, SUMMARY_POS will be non-zero. We will write the file starting from SUMMAY_POS. */ @@ -433,11 +421,18 @@ write_one_data (const struct gcov_info *gi_ptr, continue; n_counts = ci_ptr->num; - gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), - GCOV_TAG_COUNTER_LENGTH (n_counts)); - c_ptr = ci_ptr->values; - while (n_counts--) - gcov_write_counter (*c_ptr++); + + if (gi_ptr->merge[t_ix] == __gcov_merge_topn) + write_top_counters (ci_ptr, t_ix, n_counts); + else + { + gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), + GCOV_TAG_COUNTER_LENGTH (n_counts)); + c_ptr = ci_ptr->values; + while (n_counts--) + gcov_write_counter (*c_ptr++); + } + ci_ptr++; } if (buffered) @@ -476,9 +471,6 @@ dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, gcov_unsigned_t tag; fn_buffer = 0; - /* Prune current counters before we merge them. */ - prune_counters (gi_ptr); - error = gcov_exit_open_gcda_file (gi_ptr, gf); if (error == -1) return; diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index c0785b0..1acdaa0 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -86,86 +86,6 @@ __gcov_merge_time_profile (gcov_type *counters, unsigned n_counters) #ifdef L_gcov_merge_topn -/* To merging of TOPN profiles. - counters[0] is the number of executions - for i in 0 ... TOPN-1 - counters[2 * i + 1] is target - counters[2 * i + 2] is corresponding hitrate counter. - - Because we prune counters only those with probability >= 1/TOPN are - present now. - - We use sign of counters[0] to track whether the number of different - targets exceeds TOPN. */ - -static void -merge_topn_values_set (gcov_type *counters) -{ - /* First value is number of total executions of the profiler. */ - gcov_type all = gcov_get_counter (); - gcov_type *total = &counters[0]; - ++counters; - - /* Negative value means that counter is missing some of values. */ - if (all < 0) - *total = -(*total); - - *total += all; - - /* Read all part values. */ - gcov_type read_counters[2 * GCOV_TOPN_VALUES]; - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - { - read_counters[2 * i] = gcov_get_counter_target (); - read_counters[2 * i + 1] = gcov_get_counter_ignore_scaling (-1); - } - - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - { - if (read_counters[2 * i + 1] == 0) - continue; - - unsigned j; - int slot = 0; - - for (j = 0; j < GCOV_TOPN_VALUES; j++) - { - if (counters[2 * j] == read_counters[2 * i]) - { - counters[2 * j + 1] += read_counters[2 * i + 1]; - break; - } - else if (counters[2 * j + 1] < counters[2 * slot + 1]) - slot = j; - } - - if (j == GCOV_TOPN_VALUES) - { - gcov_type slot_count = counters[2 * slot + 1]; - /* We found an empty slot. */ - if (slot_count == 0) - { - /* If we found empty slot, add the value. */ - counters[2 * slot] = read_counters[2 * i]; - counters[2 * slot + 1] = read_counters[2 * i + 1]; - } - else - { - /* Here we are loosing some values. */ - if (*total >= 0) - *total = -(*total); - if (read_counters[2 * i + 1] > slot_count) - { - counters[2 * slot] = read_counters[2 * i]; - counters[2 * slot + 1] = read_counters[2 * i + 1]; - } - else - counters[2 * slot + 1] -= read_counters[2 * i + 1]; - } - } - } -} - /* The profile merging function for choosing the most common value. It is given an array COUNTERS of N_COUNTERS old counters and it reads the same number of counters from the gcov file. The counters @@ -175,13 +95,30 @@ merge_topn_values_set (gcov_type *counters) -- the stored candidate on the most common value of the measured entity -- counter */ + void __gcov_merge_topn (gcov_type *counters, unsigned n_counters) { - gcc_assert (!(n_counters % GCOV_TOPN_VALUES_COUNTERS)); + gcc_assert (!(n_counters % GCOV_TOPN_MEM_COUNTERS)); - for (unsigned i = 0; i < (n_counters / GCOV_TOPN_VALUES_COUNTERS); i++) - merge_topn_values_set (counters + (i * GCOV_TOPN_VALUES_COUNTERS)); + for (unsigned i = 0; i < (n_counters / GCOV_TOPN_MEM_COUNTERS); i++) + { + /* First value is number of total executions of the profiler. */ + gcov_type all = gcov_get_counter_ignore_scaling (-1); + gcov_type n = gcov_get_counter_ignore_scaling (-1); + + counters[GCOV_TOPN_MEM_COUNTERS * i] += all; + + for (unsigned j = 0; j < n; j++) + { + gcov_type value = gcov_get_counter_target (); + gcov_type count = gcov_get_counter_ignore_scaling (-1); + + // TODO: we should use atomic here + gcov_topn_add_value (counters + GCOV_TOPN_MEM_COUNTERS * i, value, + count, 0, 0); + } + } } #endif /* L_gcov_merge_topn */ diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 6043ac4..7b17138 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -105,51 +105,13 @@ __gcov_pow2_profiler_atomic (gcov_type *counters, gcov_type value) } #endif - /* Tries to determine N most commons value among its inputs. */ static inline void __gcov_topn_values_profiler_body (gcov_type *counters, gcov_type value, int use_atomic) { - if (use_atomic) - __atomic_fetch_add (&counters[0], 1, __ATOMIC_RELAXED); - else - counters[0]++; - - ++counters; - - /* First try to find an existing value. */ - int empty_counter = -1; - - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - if (value == counters[2 * i]) - { - if (use_atomic) - __atomic_fetch_add (&counters[2 * i + 1], GCOV_TOPN_VALUES, - __ATOMIC_RELAXED); - else - counters[2 * i + 1] += GCOV_TOPN_VALUES; - return; - } - else if (counters[2 * i + 1] <= 0) - empty_counter = i; - - /* Find an empty slot for a new value. */ - if (empty_counter != -1) - { - counters[2 * empty_counter] = value; - counters[2 * empty_counter + 1] = GCOV_TOPN_VALUES; - return; - } - - /* We haven't found an empty slot, then decrement all - counter values by one. */ - for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) - if (use_atomic) - __atomic_fetch_sub (&counters[2 * i + 1], 1, __ATOMIC_RELAXED); - else - counters[2 * i + 1]--; + gcov_topn_add_value (counters, value, 1, use_atomic, 1); } #ifdef L_gcov_topn_values_profiler diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index b248690..bc38f4d 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -373,6 +373,93 @@ gcov_get_counter_target (void) #endif } +/* Add VALUE to *COUNTER and make it with atomic operation + if USE_ATOMIC is true. */ + +static inline void +gcov_counter_add (gcov_type *counter, gcov_type value, int use_atomic) +{ + if (use_atomic) + __atomic_fetch_add (counter, value, __ATOMIC_RELAXED); + else + *counter += value; +} + +/* Set NODE to memory location COUNTER and make it with atomic operation + if USE_ATOMIC is true. */ + +static inline int +gcov_counter_set_if_null (gcov_type *counter, struct gcov_kvp *node, + int use_atomic) +{ + if (use_atomic) + return !__sync_val_compare_and_swap (counter, NULL, (intptr_t)node); + else + { + *counter = (intptr_t)node; + return 1; + } +} + +/* Add key value pair VALUE:COUNT to a top N COUNTERS. When INCREMENT_TOTAL + is true, add COUNT to total of the TOP counter. If USE_ATOMIC is true, + do it in atomic way. */ + +static inline void +gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count, + int use_atomic, int increment_total) +{ + if (increment_total) + gcov_counter_add (&counters[0], 1, use_atomic); + + struct gcov_kvp *prev_node = NULL; + struct gcov_kvp *minimal_node = NULL; + struct gcov_kvp *current_node = (struct gcov_kvp *)counters[2]; + + while (current_node) + { + if (current_node->value == value) + { + gcov_counter_add (¤t_node->count, count, use_atomic); + return; + } + + if (minimal_node == NULL + || current_node->count < minimal_node->count) + minimal_node = current_node; + + prev_node = current_node; + current_node = current_node->next; + } + + if (counters[1] == GCOV_TOPN_MAXIMUM_TRACKED_VALUES) + { + if (--minimal_node->count < count) + { + minimal_node->value = value; + minimal_node->count = count; + } + } + else + { + struct gcov_kvp *new_node + = (struct gcov_kvp *)xmalloc (sizeof (struct gcov_kvp)); + new_node->value = value; + new_node->count = count; + + int success = 0; + if (!counters[2]) + success = gcov_counter_set_if_null (&counters[2], new_node, use_atomic); + else if (prev_node && !prev_node->next) + success = gcov_counter_set_if_null ((gcov_type *)&prev_node->next, + new_node, use_atomic); + + /* Increment number of nodes. */ + if (success) + gcov_counter_add (&counters[1], 1, use_atomic); + } +} + #endif /* !inhibit_libc */ #endif /* GCC_LIBGCOV_H */ -- cgit v1.1 From a04b7410d305800b747963ab940d2b1a602b5ddf Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 2 Jun 2020 13:57:31 +0200 Subject: 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. --- libgcc/libgcov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index bc38f4d..7c037a9 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -443,7 +443,7 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count, else { struct gcov_kvp *new_node - = (struct gcov_kvp *)xmalloc (sizeof (struct gcov_kvp)); + = (struct gcov_kvp *)xcalloc (1, sizeof (struct gcov_kvp)); new_node->value = value; new_node->count = count; -- cgit v1.1 From 4013baf99c38f7bca06a51f8301e8fb195ccfa33 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 2 Jun 2020 11:19:39 -0700 Subject: 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. --- libgcc/config/riscv/div.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config/riscv/div.S b/libgcc/config/riscv/div.S index 151f8e2..1723432 100644 --- a/libgcc/config/riscv/div.S +++ b/libgcc/config/riscv/div.S @@ -107,10 +107,12 @@ FUNC_END (__umoddi3) /* Handle negative arguments to __divdi3. */ .L10: neg a0, a0 - bgez a1, .L12 /* Compute __udivdi3(-a0, a1), then negate the result. */ + /* Zero is handled as a negative so that the result will not be inverted. */ + bgtz a1, .L12 /* Compute __udivdi3(-a0, a1), then negate the result. */ + neg a1, a1 - j __udivdi3 /* Compute __udivdi3(-a0, -a1). */ -.L11: /* Compute __udivdi3(a0, -a1), then negate the result. */ + j __udivdi3 /* Compute __udivdi3(-a0, -a1). */ +.L11: /* Compute __udivdi3(a0, -a1), then negate the result. */ neg a1, a1 .L12: move t0, ra -- cgit v1.1 From a9312a7926079ddb78b5f93681a9f6823422f5e1 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 3 Jun 2020 00:16:34 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e39bd90..0b42282 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,30 @@ +2020-06-02 Jim Wilson + + * config/riscv/div.S (__divdi3): For negative arguments, change bgez + to bgtz. + +2020-06-02 Martin Liska + + * libgcov.h (gcov_topn_add_value): Use xcalloc instead + of xmalloc. + +2020-06-02 Martin Liska + + * 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-01 Uroš Bizjak * config/i386/sfp-exceptions.c (struct fenv): -- cgit v1.1 From eb3480fc0fe68c0062a5548e922d530c78121cb5 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 2 Jun 2020 16:57:35 +0200 Subject: 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. --- libgcc/libgcov-profiler.c | 11 ----------- libgcc/libgcov.h | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 7b17138..45ab93c 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -26,17 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgcov.h" #if !defined(inhibit_libc) -/* Detect whether target can support atomic update of profilers. */ -#if __SIZEOF_LONG_LONG__ == 4 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -#define GCOV_SUPPORTS_ATOMIC 1 -#else -#if __SIZEOF_LONG_LONG__ == 8 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -#define GCOV_SUPPORTS_ATOMIC 1 -#else -#define GCOV_SUPPORTS_ATOMIC 0 -#endif -#endif - #ifdef L_gcov_interval_profiler /* If VALUE is in interval , then increases the corresponding counter in COUNTERS. If the VALUE is above or below diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 7c037a9..1456100 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -85,6 +85,19 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (QI))); #define GCOV_LOCKED 0 #endif +#ifndef GCOV_SUPPORTS_ATOMIC +/* Detect whether target can support atomic update of profilers. */ +#if __SIZEOF_LONG_LONG__ == 4 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define GCOV_SUPPORTS_ATOMIC 1 +#else +#if __SIZEOF_LONG_LONG__ == 8 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 +#define GCOV_SUPPORTS_ATOMIC 1 +#else +#define GCOV_SUPPORTS_ATOMIC 0 +#endif +#endif +#endif + /* In libgcov we need these functions to be extern, so prefix them with __gcov. In libgcov they must also be hidden so that the instance in the executable is not also used in a DSO. */ @@ -377,11 +390,14 @@ gcov_get_counter_target (void) if USE_ATOMIC is true. */ static inline void -gcov_counter_add (gcov_type *counter, gcov_type value, int use_atomic) +gcov_counter_add (gcov_type *counter, gcov_type value, + int use_atomic ATTRIBUTE_UNUSED) { +#if GCOV_SUPPORTS_ATOMIC if (use_atomic) __atomic_fetch_add (counter, value, __ATOMIC_RELAXED); else +#endif *counter += value; } @@ -390,11 +406,13 @@ gcov_counter_add (gcov_type *counter, gcov_type value, int use_atomic) static inline int gcov_counter_set_if_null (gcov_type *counter, struct gcov_kvp *node, - int use_atomic) + int use_atomic ATTRIBUTE_UNUSED) { +#if GCOV_SUPPORTS_ATOMIC if (use_atomic) return !__sync_val_compare_and_swap (counter, NULL, (intptr_t)node); else +#endif { *counter = (intptr_t)node; return 1; -- cgit v1.1 From 9a5b7438c85a926a0dba9dc980039f3d67571763 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 4 Jun 2020 00:16:34 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 0b42282..3b20f6f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2020-06-03 Martin Liska + + 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-02 Jim Wilson * config/riscv/div.S (__divdi3): For negative arguments, change bgez -- cgit v1.1 From 0ecf5229723ec99e6b5099dd68d48bd925da6b0d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 21 Nov 2013 15:15:40 +0100 Subject: 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. --- libgcc/config/ia64/divtf3.c | 9 +++++++++ libgcc/config/ia64/t-softfp-compat | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 libgcc/config/ia64/divtf3.c (limited to 'libgcc') diff --git a/libgcc/config/ia64/divtf3.c b/libgcc/config/ia64/divtf3.c new file mode 100644 index 0000000..e1afa29 --- /dev/null +++ b/libgcc/config/ia64/divtf3.c @@ -0,0 +1,9 @@ +#ifdef SHARED +#define __divtf3 __divtf3_shared +#endif + +#include "soft-fp/divtf3.c" + +#ifdef SHARED +asm (".symver __divtf3_shared, __divtf3@@GCC_4.4.0"); +#endif diff --git a/libgcc/config/ia64/t-softfp-compat b/libgcc/config/ia64/t-softfp-compat index 00f45d5..38bcea7 100644 --- a/libgcc/config/ia64/t-softfp-compat +++ b/libgcc/config/ia64/t-softfp-compat @@ -5,3 +5,6 @@ libgcc1-tf-functions = __divxf3 _fixtfdi _fixunstfdi _floatditf LIB1ASMFUNCS := $(filter-out $(libgcc1-tf-functions), $(LIB1ASMFUNCS)) libgcc1-tf-compats = $(addsuffix .S, $(libgcc1-tf-functions)) LIB2ADD += $(addprefix $(srcdir)/config/ia64/, $(libgcc1-tf-compats)) +# Wrap divtf3.c to set the default symbol version +softfp_file_list := $(filter-out $(srcdir)/soft-fp/divtf3.c, $(softfp_file_list)) +LIB2ADD += $(srcdir)/config/ia64/divtf3.c -- cgit v1.1 From 3add342502b9506b6f1a0f70c156a97a7b38ef4d Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 5 Jun 2020 00:16:30 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 3b20f6f..b4e39d1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2020-06-04 Andreas Schwab + + 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-03 Martin Liska PR gcov-profile/95480 -- cgit v1.1 From 1d9921cbdc732e1a7fc66b9c24a6dfa9625bd4c0 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sat, 6 Jun 2020 05:06:04 -0700 Subject: 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 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. --- libgcc/config/xtensa/unwind-dw2-xtensa.c | 46 +++++++++++++++----------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c index 056182a..8a6a44a 100644 --- a/libgcc/config/xtensa/unwind-dw2-xtensa.c +++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c @@ -481,37 +481,35 @@ uw_init_context_1 (struct _Unwind_Context *context, void *outer_cfa, /* Install TARGET into CURRENT so that we can return to it. This is a macro because __builtin_eh_return must be invoked in the context of - our caller. */ + our caller, and also because spilling registers of the caller before + the context installation may result in reload of wrong register values + after the context installation due to the change of the stack pointer + in the base save area. This spilling may be caused by an interrupt + handler on baremetal host. */ -#define uw_install_context(CURRENT, TARGET, FRAMES) \ +#define uw_install_context(CURRENT, TARGET, FRAMES) \ do \ { \ - long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ - __builtin_eh_return (offset, handler); \ + long i; \ + \ + /* The eh_return insn assumes a window size of 8, so don't bother \ + copying the save areas for registers a8-a15 since they won't be \ + reloaded. */ \ + for (i = 0; i < 2; ++i) \ + { \ + _Unwind_Word *c = (CURRENT)->reg[i]; \ + _Unwind_Word *t = (TARGET)->reg[i]; \ + int j; \ + \ + if (t && c && t != c) \ + for (j = 0; j < 4; ++j) \ + *c++ = *t++; \ + } \ + __builtin_eh_return (0, handler); \ } \ while (0) -static long -uw_install_context_1 (struct _Unwind_Context *current, - struct _Unwind_Context *target) -{ - long i; - - /* The eh_return insn assumes a window size of 8, so don't bother copying - the save areas for registers a8-a15 since they won't be reloaded. */ - for (i = 0; i < 2; ++i) - { - void *c = current->reg[i]; - void *t = target->reg[i]; - - if (t && c && t != c) - memcpy (c, t, 4 * sizeof (_Unwind_Word)); - } - - return 0; -} - static inline _Unwind_Ptr uw_identify_context (struct _Unwind_Context *context) { -- cgit v1.1 From 862b9b225fba6cf3c63234206f2dbc47f1ab5350 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 8 Jun 2020 20:07:08 +0200 Subject: 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. --- libgcc/libgcov-driver.c | 4 ++-- libgcc/libgcov.h | 49 +++++++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 24 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index 8348d9f..cbfcae9 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -352,8 +352,8 @@ write_top_counters (const struct gcov_ctr_info *ci_ptr, gcov_type pair_count = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 1]; gcov_write_counter (ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i]); gcov_write_counter (pair_count); - for (struct gcov_kvp *node - = (struct gcov_kvp *)ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2]; + gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2]; + for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start; node != NULL; node = node->next) { gcov_write_counter (node->value); diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 1456100..5d237a4 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -401,24 +401,6 @@ gcov_counter_add (gcov_type *counter, gcov_type value, *counter += value; } -/* Set NODE to memory location COUNTER and make it with atomic operation - if USE_ATOMIC is true. */ - -static inline int -gcov_counter_set_if_null (gcov_type *counter, struct gcov_kvp *node, - int use_atomic ATTRIBUTE_UNUSED) -{ -#if GCOV_SUPPORTS_ATOMIC - if (use_atomic) - return !__sync_val_compare_and_swap (counter, NULL, (intptr_t)node); - else -#endif - { - *counter = (intptr_t)node; - return 1; - } -} - /* Add key value pair VALUE:COUNT to a top N COUNTERS. When INCREMENT_TOTAL is true, add COUNT to total of the TOP counter. If USE_ATOMIC is true, do it in atomic way. */ @@ -432,7 +414,7 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count, struct gcov_kvp *prev_node = NULL; struct gcov_kvp *minimal_node = NULL; - struct gcov_kvp *current_node = (struct gcov_kvp *)counters[2]; + struct gcov_kvp *current_node = (struct gcov_kvp *)(intptr_t)counters[2]; while (current_node) { @@ -467,10 +449,33 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count, int success = 0; if (!counters[2]) - success = gcov_counter_set_if_null (&counters[2], new_node, use_atomic); + { +#if GCOV_SUPPORTS_ATOMIC + if (use_atomic) + { + struct gcov_kvp **ptr = (struct gcov_kvp **)(intptr_t)&counters[2]; + success = !__sync_val_compare_and_swap (ptr, 0, new_node); + } + else +#endif + { + counters[2] = (intptr_t)new_node; + success = 1; + } + } else if (prev_node && !prev_node->next) - success = gcov_counter_set_if_null ((gcov_type *)&prev_node->next, - new_node, use_atomic); + { +#if GCOV_SUPPORTS_ATOMIC + if (use_atomic) + success = !__sync_val_compare_and_swap (&prev_node->next, 0, + new_node); + else +#endif + { + prev_node->next = new_node; + success = 1; + } + } /* Increment number of nodes. */ if (success) -- cgit v1.1 From b952c2cfcd74c284970e1b9bf1fca58f5f69ab23 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 10 Jun 2020 00:16:47 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b4e39d1..e3456b6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,17 @@ +2020-06-09 Martin Liska + + 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 Max Filippov + + * config/xtensa/unwind-dw2-xtensa.c (uw_install_context): Merge + with uw_install_context_1. + 2020-06-04 Andreas Schwab PR target/59230 -- cgit v1.1 From 8c8eb94914c1afcac014e33def43ce329dfa314e Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sun, 12 Apr 2020 23:53:32 -0700 Subject: gcc: xtensa: add -mabi option for call0/windowed ABI 2020-06-15 Max Filippov 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__. --- libgcc/configure | 24 +++++++++++------------- libgcc/configure.ac | 14 ++++++-------- 2 files changed, 17 insertions(+), 21 deletions(-) (limited to 'libgcc') diff --git a/libgcc/configure b/libgcc/configure index 13548ca..284e4db 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5330,19 +5330,17 @@ esac # This is after config.host so we can augment tmake_file. case ${host} in xtensa*-*) - cat > conftest.c <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - tmake_file="${tmake_file} xtensa/t-windowed" - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __XTENSA_CALL0_ABI__ + #error + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + tmake_file="${tmake_file} xtensa/t-windowed" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; esac diff --git a/libgcc/configure.ac b/libgcc/configure.ac index bff6e54..ef0d799 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -515,14 +515,12 @@ AC_SUBST(solaris_ld_v2_maps) # This is after config.host so we can augment tmake_file. case ${host} in xtensa*-*) - cat > conftest.c <&AS_MESSAGE_LOG_FD); then - tmake_file="${tmake_file} xtensa/t-windowed" - fi + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [#ifdef __XTENSA_CALL0_ABI__ + #error + #endif + ])], + [tmake_file="${tmake_file} xtensa/t-windowed"]) ;; esac -- cgit v1.1 From 6fb94d67f1a3e77462a922341dc75c05e00524d6 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 16 Jun 2020 00:16:28 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e3456b6..63167c3 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-06-15 Max Filippov + + * configure: Regenerate. + * configure.ac: Use AC_COMPILE_IFELSE instead of manual + preprocessor invocation to check for __XTENSA_CALL0_ABI__. + 2020-06-09 Martin Liska PR gcov-profile/95494 -- cgit v1.1 From 5fc312a98e9b06eac9e865f511a327b264056d66 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 16 Jun 2020 14:14:03 +0200 Subject: 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. --- libgcc/libgcov-util.c | 70 +++++++++++++++++++++++++++++++++++++++++++-------- libgcc/libgcov.h | 2 +- 2 files changed, 61 insertions(+), 11 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index fff54c6..224c190 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -243,7 +243,7 @@ read_gcda_finalize (struct gcov_info *obj_info) /* We set the following fields: merge, n_functions, functions and summary. */ obj_info->n_functions = num_fn_info; - obj_info->functions = (const struct gcov_fn_info**) obstack_finish (&fn_info); + obj_info->functions = (struct gcov_fn_info**) obstack_finish (&fn_info); /* wrap all the counter array. */ for (i=0; i< GCOV_COUNTERS; i++) @@ -506,14 +506,58 @@ gcov_get_merge_weight (void) value buffer and weights and then calls the merge function. */ static void -merge_wrapper (gcov_merge_fn f, gcov_type *v1, gcov_unsigned_t n, - gcov_type *v2, unsigned w) +merge_wrapper (gcov_merge_fn f, gcov_type *v1, gcov_unsigned_t n1, + gcov_type *v2, gcov_unsigned_t n2, unsigned w) { gcov_value_buf = v2; gcov_value_buf_pos = 0; - gcov_value_buf_size = n; + gcov_value_buf_size = n2; gcov_merge_weight = w; - (*f) (v1, n); + (*f) (v1, n1); +} + +/* Convert on disk representation of a TOPN counter to in memory representation + that is expected from __gcov_merge_topn function. */ + +static void +topn_to_memory_representation (struct gcov_ctr_info *info) +{ + auto_vec output; + gcov_type *values = info->values; + int count = info->num; + + while (count > 0) + { + output.safe_push (values[0]); + gcov_type n = values[1]; + output.safe_push (n); + if (n > 0) + { + struct gcov_kvp *tuples + = (struct gcov_kvp *)xcalloc (sizeof (struct gcov_kvp), n); + for (unsigned i = 0; i < n - 1; i++) + tuples[i].next = &tuples[i + 1]; + for (unsigned i = 0; i < n; i++) + { + tuples[i].value = values[2 + 2 * i]; + tuples[i].count = values[2 + 2 * i + 1]; + } + output.safe_push ((intptr_t)&tuples[0]); + } + else + output.safe_push (0); + + unsigned len = 2 * n + 2; + values += len; + count -= len; + } + gcc_assert (count == 0); + + /* Allocate new buffer and copy it there. */ + info->num = output.length (); + info->values = (gcov_type *)xmalloc (sizeof (gcov_type) * info->num); + for (unsigned i = 0; i < info->num; i++) + info->values[i] = output[i]; } /* Offline tool to manipulate profile data. @@ -543,9 +587,9 @@ gcov_merge (struct gcov_info *info1, struct gcov_info *info2, int w) for (f_ix = 0; f_ix < n_functions; f_ix++) { unsigned t_ix; - const struct gcov_fn_info *gfi_ptr1 = info1->functions[f_ix]; - const struct gcov_fn_info *gfi_ptr2 = info2->functions[f_ix]; - const struct gcov_ctr_info *ci_ptr1, *ci_ptr2; + struct gcov_fn_info *gfi_ptr1 = info1->functions[f_ix]; + struct gcov_fn_info *gfi_ptr2 = info2->functions[f_ix]; + struct gcov_ctr_info *ci_ptr1, *ci_ptr2; if (!gfi_ptr1 || gfi_ptr1->key != info1) continue; @@ -569,8 +613,14 @@ gcov_merge (struct gcov_info *info1, struct gcov_info *info2, int w) gcc_assert (merge1 == merge2); if (!merge1) continue; - gcc_assert (ci_ptr1->num == ci_ptr2->num); - merge_wrapper (merge1, ci_ptr1->values, ci_ptr1->num, ci_ptr2->values, w); + + if (merge1 == __gcov_merge_topn) + topn_to_memory_representation (ci_ptr1); + else + gcc_assert (ci_ptr1->num == ci_ptr2->num); + + merge_wrapper (merge1, ci_ptr1->values, ci_ptr1->num, + ci_ptr2->values, ci_ptr2->num, w); ci_ptr1++; ci_ptr2++; } diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 5d237a4..ffa9a69 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -216,7 +216,7 @@ struct gcov_info const struct gcov_fn_info *const *functions; /* pointer to pointers to function information */ #else - const struct gcov_fn_info **functions; + struct gcov_fn_info **functions; #endif /* !IN_GCOV_TOOL */ }; -- cgit v1.1 From 5e2eebc80d6eeca24745c27a925afdb64292ed22 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 29 May 2020 13:46:50 +0200 Subject: hurd: libgcc unwinding support over signal trampolines libgcc/ * config.host (md_unwind_header) : Set to 'i386/gnu-unwind.h' * config/i386/gnu-unwind.h: New file. Signed-off-by: Thomas Schwinge --- libgcc/config.host | 8 ++- libgcc/config/i386/gnu-unwind.h | 107 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 libgcc/config/i386/gnu-unwind.h (limited to 'libgcc') diff --git a/libgcc/config.host b/libgcc/config.host index 2cd4209..044b34d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -734,11 +734,17 @@ i[34567]86-*-linux*) tm_file="${tm_file} i386/elf-lib.h" md_unwind_header=i386/linux-unwind.h ;; -i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) +i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-kopensolaris*-gnu) extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules" tm_file="${tm_file} i386/elf-lib.h" ;; +i[34567]86-*-gnu*) + extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" + tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules" + tm_file="${tm_file} i386/elf-lib.h" + md_unwind_header=i386/gnu-unwind.h + ;; x86_64-*-linux*) extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules" diff --git a/libgcc/config/i386/gnu-unwind.h b/libgcc/config/i386/gnu-unwind.h new file mode 100644 index 0000000..db47f0a --- /dev/null +++ b/libgcc/config/i386/gnu-unwind.h @@ -0,0 +1,107 @@ +/* DWARF2 EH unwinding support for GNU Hurd: x86. + Copyright (C) 2020 Free Software Foundation, Inc. + Contributed by Samuel Thibault + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +#ifndef inhibit_libc + +#include + +#define MD_FALLBACK_FRAME_STATE_FOR x86_gnu_fallback_frame_state + +static _Unwind_Reason_Code +x86_gnu_fallback_frame_state +(struct _Unwind_Context *context, _Unwind_FrameState *fs) +{ + struct handler_args { + int signo; + int sigcode; + struct sigcontext *scp; + } *handler_args; + struct sigcontext *scp; + unsigned long usp; + +/* + * i386 sigtramp frame we are looking for follows. + * (see glibc/sysdeps/mach/hurd/i386/trampoline.c assembly) + * + * rpc_wait_trampoline: + * 0: b8 e7 ff ff ff mov $-25,%eax mach_msg_trap + * 5: 9a 00 00 00 00 07 00 lcall $7,$0 + * 12: 89 01 movl %eax, (%ecx) + * 14: 89 dc movl %ebx, %esp switch to signal stack + * + * trampoline: + * 16: ff d2 call *%edx call the handler function + * RA HERE + * 18: 83 c4 0c addl $12, %esp pop its args + * 21: c3 ret return to sigreturn + * + * firewall: + * 22: f4 hlt + */ + + if (!( *(unsigned int *)(context->ra ) == 0xc30cc483 + && *(unsigned char *)(context->ra + 4) == 0xf4 + + && *(unsigned int *)(context->ra - 4) == 0xd2ffdc89 + && *(unsigned int *)(context->ra - 8) == 0x01890007 + && *(unsigned int *)(context->ra - 12) == 0x00000000 + && *(unsigned int *)(context->ra - 16) == 0x9affffff + && *(unsigned short *)(context->ra - 18) == 0xe7b8)) + return _URC_END_OF_STACK; + + handler_args = context->cfa; + scp = handler_args->scp; + usp = scp->sc_uesp; + + fs->regs.cfa_how = CFA_REG_OFFSET; + fs->regs.cfa_reg = 4; + fs->regs.cfa_offset = usp - (unsigned long) context->cfa; + + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = (unsigned long)&scp->sc_eax - usp; + fs->regs.reg[1].how = REG_SAVED_OFFSET; + fs->regs.reg[1].loc.offset = (unsigned long)&scp->sc_ecx - usp; + fs->regs.reg[2].how = REG_SAVED_OFFSET; + fs->regs.reg[2].loc.offset = (unsigned long)&scp->sc_edx - usp; + fs->regs.reg[3].how = REG_SAVED_OFFSET; + fs->regs.reg[3].loc.offset = (unsigned long)&scp->sc_ebx - usp; + fs->regs.reg[5].how = REG_SAVED_OFFSET; + fs->regs.reg[5].loc.offset = (unsigned long)&scp->sc_ebp - usp; + fs->regs.reg[6].how = REG_SAVED_OFFSET; + fs->regs.reg[6].loc.offset = (unsigned long)&scp->sc_esi - usp; + fs->regs.reg[7].how = REG_SAVED_OFFSET; + fs->regs.reg[7].loc.offset = (unsigned long)&scp->sc_edi - usp; + fs->regs.reg[8].how = REG_SAVED_OFFSET; + fs->regs.reg[8].loc.offset = (unsigned long)&scp->sc_eip - usp; + fs->retaddr_column = 8; + fs->signal_frame = 1; + + return _URC_NO_REASON; +} + +#endif /* ifndef inhibit_libc */ -- cgit v1.1 From aff95ee7cc2c046d69ff6f79990930fb22e0e808 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 18 Jun 2020 00:16:37 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 63167c3..a569a41 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,18 @@ +2020-06-17 Samuel Thibault + + * config.host (md_unwind_header) : Set to + 'i386/gnu-unwind.h' + * config/i386/gnu-unwind.h: New file. + +2020-06-17 Martin Liska + + * 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-15 Max Filippov * configure: Regenerate. -- cgit v1.1 From 47ddb895df311e546a6f54345e18b8749ac50324 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Fri, 15 May 2020 17:46:08 -0400 Subject: 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 * 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 * 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 * 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 * 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 * 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 * 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. --- libgcc/config.host | 2 +- libgcc/config/rs6000/t-aix-cxa | 15 +++++++-- libgcc/config/rs6000/t-slibgcc-aix | 69 +++++++++++++++++++++++++++----------- 3 files changed, 62 insertions(+), 24 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config.host b/libgcc/config.host index 044b34d..7a3e29d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1273,7 +1273,7 @@ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) md_unwind_header=rs6000/aix-unwind.h tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-slibgcc-aix rs6000/t-ibm-ldouble rs6000/t-aix-cxa" - extra_parts="crtcxa.o crtcxa_s.o crtdbase.o" + extra_parts="crtcxa.o crtcxa_s.o crtdbase.o crtcxa_64.o crtcxa_64_s.o crtdbase_64.o" ;; rl78-*-elf) tmake_file="$tm_file t-fdpbit rl78/t-rl78" diff --git a/libgcc/config/rs6000/t-aix-cxa b/libgcc/config/rs6000/t-aix-cxa index d7e6638..0e1bccb 100644 --- a/libgcc/config/rs6000/t-aix-cxa +++ b/libgcc/config/rs6000/t-aix-cxa @@ -8,10 +8,19 @@ LIB2ADD_ST += $(srcdir)/config/rs6000/aixinitfini.c SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-aix-cxa.ver crtdbase.o: $(srcdir)/config/rs6000/crtdbase.S - $(crt_compile) -c $< + $(crt_compile) -maix32 -c $< crtcxa.o: $(srcdir)/config/rs6000/crtcxa.c - $(crt_compile) -c $< + $(crt_compile) -maix32 -c $< crtcxa_s.o: $(srcdir)/config/rs6000/crtcxa.c - $(crt_compile) -DSHARED -c $< + $(crt_compile) -maix32 -DSHARED -c $< + +crtdbase_64.o: $(srcdir)/config/rs6000/crtdbase.S + $(crt_compile) -maix64 -c $< + +crtcxa_64.o: $(srcdir)/config/rs6000/crtcxa.c + $(crt_compile) -maix64 -c $< + +crtcxa_64_s.o: $(srcdir)/config/rs6000/crtcxa.c + $(crt_compile) -maix64 -DSHARED -c $< diff --git a/libgcc/config/rs6000/t-slibgcc-aix b/libgcc/config/rs6000/t-slibgcc-aix index 11db9ef..e5f8a02 100644 --- a/libgcc/config/rs6000/t-slibgcc-aix +++ b/libgcc/config/rs6000/t-slibgcc-aix @@ -37,48 +37,44 @@ SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION) SHLIB_LINK = \ if test svr4 != $(with_aix_soname) ; then \ $(CC) $(LIBGCC2_CFLAGS) -shared -Wl,-bnortl -nodefaultlibs \ - -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \ + -Wl,-bE:@shlib_map_file@ -o shr.o \ @multilib_flags@ @shlib_objs@ -lc \ `case @multilib_dir@ in \ *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \ *) echo -lc ;; esac` ; \ - rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \ - $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \ - @multilib_dir@/shr.o ; \ - mv @multilib_dir@/tmp-@shlib_base_name@.a \ - @multilib_dir@/@shlib_base_name@.a ; \ - rm -f @multilib_dir@/shr.o ; \ + rm -f tmp-@shlib_base_name@.a ; \ + $(AR_CREATE_FOR_TARGET) tmp-@shlib_base_name@.a shr.o ; \ + mv tmp-@shlib_base_name@.a @shlib_base_name@.a ; \ + rm -f shr.o ; \ fi ; \ if test aix != $(with_aix_soname) ; then \ case @multilib_dir@ in *64*) shr='shr_64' ;; *) shr='shr' ;; esac ; \ $(CC) $(LIBGCC2_CFLAGS) -shared -Wl,-G -nodefaultlibs \ - -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/$$shr.o \ + -Wl,-bE:@shlib_map_file@ -o $$shr.o \ @multilib_flags@ @shlib_objs@ -lc \ `case @multilib_dir@ in \ *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \ *) echo -lc ;; esac` ; \ - $(STRIP_FOR_TARGET) -X32_64 -e @multilib_dir@/$$shr.o ; \ + $(STRIP_FOR_TARGET) -X32_64 -e $$shr.o ; \ { echo "\#! $(SHLIB_SONAME)($$shr.o)" ; \ case @multilib_dir@ in *64*) echo '\# 64' ;; *) echo '\# 32' ;; esac ; \ cat @shlib_map_file@ ; \ - } > @multilib_dir@/$$shr.imp ; \ - rm -f @multilib_dir@/tmp-$(SHLIB_SONAME) ; \ - $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-$(SHLIB_SONAME) \ - @multilib_dir@/$$shr.imp @multilib_dir@/$$shr.o ; \ - mv @multilib_dir@/tmp-$(SHLIB_SONAME) \ - @multilib_dir@/$(SHLIB_SONAME) ; \ - rm -f @multilib_dir@/@shlib_base_name@.so ; \ - $(LN_S) $(SHLIB_SONAME) @multilib_dir@/@shlib_base_name@.so ; \ - rm -f @multilib_dir@/$$shr.imp @multilib_dir@/$$shr.o ; \ + } > $$shr.imp ; \ + rm -f tmp-$(SHLIB_SONAME) ; \ + $(AR_CREATE_FOR_TARGET) tmp-$(SHLIB_SONAME) $$shr.imp $$shr.o ; \ + mv tmp-$(SHLIB_SONAME) $(SHLIB_SONAME) ; \ + rm -f @shlib_base_name@.so ; \ + $(LN_S) $(SHLIB_SONAME) @shlib_base_name@.so ; \ + rm -f $$shr.imp $$shr.o ; \ fi SHLIB_INSTALL = \ $(mkinstalldirs) $(DESTDIR)$(slibdir)@shlib_slibdir_qual@; \ if test svr4 != $(with_aix_soname) ; then \ - $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \ + $(INSTALL_DATA) @shlib_base_name@.a \ $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/ ; \ fi ; \ if test aix != $(with_aix_soname) ; then \ - $(INSTALL_DATA) @multilib_dir@/$(SHLIB_SONAME) \ + $(INSTALL_DATA) $(SHLIB_SONAME) \ $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/ ; \ rm -f $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so ; \ $(LN_S) $(SHLIB_SONAME) \ @@ -91,3 +87,36 @@ SHLIB_NM_FLAGS = -Bpg -X32_64 # Either 32-bit and 64-bit objects in archives. AR_FLAGS_FOR_TARGET = -X32_64 + +# Build and install AIX-style FAT libraries +ifeq ($(MULTIBUILDTOP),) +BITS=$(shell if test -z "`ar -X64 t libgcc_s.a`" ; then \ + echo '64'; else echo '32'; fi) +all: all-multi +ifeq ($(enable_shared),yes) + ar -X$(BITS) x ../ppc$(BITS)/libgcc/libgcc_s.a shr.o + ar -X$(BITS) rc ./libgcc_s.a shr.o + rm -f shr.o + ar -X$(BITS) x ../pthread/ppc$(BITS)/libgcc/libgcc_s.a shr.o + ar -X$(BITS) rc ../pthread/libgcc/libgcc_s.a shr.o + rm -f shr.o +endif + ar -X$(BITS) rc libgcc.a \ + $(addprefix ../ppc$(BITS)/libgcc/,$(libgcc-objects)) + ar -X$(BITS) rc libgcc_eh.a \ + $(addprefix ../ppc$(BITS)/libgcc/,$(libgcc-eh-objects)) + ar -X$(BITS) rc ../pthread/libgcc/libgcc.a \ + $(addprefix ../pthread/ppc$(BITS)/libgcc/,$(libgcc-objects)) + ar -X$(BITS) rc ../pthread/libgcc/libgcc_eh.a \ + $(addprefix ../pthread/ppc$(BITS)/libgcc/,$(libgcc-eh-objects)) +ifeq ($(enable_gcov),yes) + ar -X$(BITS) rc libgcov.a \ + $(addprefix ../ppc$(BITS)/libgcc/,$(libgcov-objects)) + ar -X$(BITS) rc ../pthread/libgcc/libgcov.a \ + $(addprefix ../pthread/ppc$(BITS)/libgcc/,$(libgcov-objects)) +endif + $(MAKE) install-leaf DESTDIR=$(gcc_objdir) \ + slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR) + cp ../pthread/libgcc/libgcc_s.a ../../gcc/pthread/ + cp ../pthread/libgcc/libgcc_eh.a ../../gcc/pthread/ +endif -- cgit v1.1 From f86e11a267aa70c56b300cfe60cfe3a27111b204 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 22 Jun 2020 00:16:23 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index a569a41..8d36724 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2020-06-21 David Edelsohn + + * 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. + 2020-06-17 Samuel Thibault * config.host (md_unwind_header) : Set to -- cgit v1.1 From 17964eb3a054c634b743aae9d1d9414e1bf21885 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Tue, 23 Jun 2020 10:03:40 -0400 Subject: 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 * Makefile.in (LANG_MAKEFRAGS): Same. (tmake_file): Use -include. (xmake_file): Same. libgcc/ChangeLog 2020-06-23 David Edelsohn * 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 * t-libf7: Same. --- libgcc/Makefile.in | 22 +++++++++++----------- libgcc/config/avr/libf7/t-libf7 | 4 ++-- libgcc/config/avr/t-avr | 10 +++++----- libgcc/empty.mk | 2 -- 4 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 libgcc/empty.mk (limited to 'libgcc') diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 5c50f9f..d6075d3 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -373,7 +373,7 @@ gthr-default.h: $(srcdir)/$(thread_header) -$(LN_S) $< $@ tmake_file = @tmake_file@ -include $(srcdir)/empty.mk $(tmake_file) +-include $(tmake_file) # Collect target defines and headers from config.host. libgcc_tm_defines = @tm_defines@ @@ -393,7 +393,7 @@ ifeq ($(SHLIB_LINK),) endif ifeq ($(enable_shared),yes) - iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items)) + iterator = $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items)) install-shared = install-shared @@ -425,7 +425,7 @@ gen-hide-list = echo > $@ endif ifneq ($(enable_shared),yes) -iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) +iterator = $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) endif LIB2ADD += enable-execute-stack.c @@ -522,7 +522,7 @@ iter-items := $(sifuncs) $(difuncs) $(tifuncs) iter-labels := $(sifuncs) $(difuncs) $(difuncs) iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs)) ifeq ($(enable_shared),yes) @@ -805,7 +805,7 @@ iter-items := $(fixed-funcs) iter-labels := $(fixed-labels) iter-from := $(fixed-modes) iter-to := $(fixed-modes) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) # Add arithmetic functions to list of objects to be built libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs))) @@ -824,7 +824,7 @@ iter-items := $(fixed-conv-funcs) iter-labels := $(fixed-conv-labels) iter-from := $(fixed-conv-from) iter-to := $(fixed-conv-to) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) # Add conversion functions to list of objects to be built libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs))) @@ -844,7 +844,7 @@ libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST)))) c_flags := iter-items := $(LIB2ADD) $(LIB2ADD_ST) -include $(iterator) +-include $(iterator) ifeq ($(enable_shared),yes) libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADD)))) @@ -862,7 +862,7 @@ libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED)))) iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED)) -include $(iterator) +-include $(iterator) else # Not shared. LIB2ADDEH are added to libgcc.a. @@ -870,7 +870,7 @@ else libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH)))) iter-items := $(LIB2ADDEH) -include $(iterator) +-include $(iterator) endif @@ -886,7 +886,7 @@ libunwind-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIBUNWIND)) endif iter-items := $(LIBUNWIND) -include $(iterator) +-include $(iterator) # Build libgcov components. @@ -1203,4 +1203,4 @@ install-strip: install # configure. .NOEXPORT: -include $(srcdir)/empty.mk $(wildcard *.dep) +-include $(wildcard *.dep) diff --git a/libgcc/config/avr/libf7/t-libf7 b/libgcc/config/avr/libf7/t-libf7 index 92a27eb..30aa280 100644 --- a/libgcc/config/avr/libf7/t-libf7 +++ b/libgcc/config/avr/libf7/t-libf7 @@ -125,7 +125,7 @@ f7_parts := $(F7_C_PARTS) iter-items := $(f7_parts) iter-labels := $(f7_parts) -include $(srcdir)/empty.mk $(patsubst %,$(libf7)/libf7-c-object.mk,$(iter-items)) +-include $(patsubst %,$(libf7)/libf7-c-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,f7_c_%$(objext),$(F7_C_PARTS)) @@ -136,7 +136,7 @@ f7_parts := $(F7_ASM_PARTS) iter-items := $(f7_parts) iter-labels := $(f7_parts) -include $(srcdir)/empty.mk $(patsubst %,$(libf7)/libf7-asm-object.mk,$(iter-items)) +-include $(patsubst %,$(libf7)/libf7-asm-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,f7_asm_%$(objext),$(F7_ASM_PARTS)) diff --git a/libgcc/config/avr/t-avr b/libgcc/config/avr/t-avr index e4f867b..ed84b3f 100644 --- a/libgcc/config/avr/t-avr +++ b/libgcc/config/avr/t-avr @@ -132,7 +132,7 @@ iter-labels := $(siintfuncs16) iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16)) ifeq ($(enable_shared),yes) @@ -167,7 +167,7 @@ iter-items := $(round_funcs) iter-labels := $(round_suffix) iter-flags := $(patsubst %,-DL_round,$(iter-items)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(round_funcs)) @@ -181,7 +181,7 @@ iter-items := $(clrsb_funcs) iter-labels := $(clrsb_funcs) iter-flags := $(patsubst %,-DL_clrsb,$(iter-items)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(clrsb_funcs)) @@ -195,7 +195,7 @@ iter-items := $(countls_funcs) iter-labels := $(countls_modes) iter-flags := $(patsubst %,-DL_countls,$(iter-items)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(countls_funcs)) @@ -209,7 +209,7 @@ iter-items := $(countlsu_funcs) iter-labels := $(countlsu_modes) iter-flags := $(patsubst %,-DL_countlsu,$(iter-items)) -include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) +-include $(patsubst %,$(srcdir)/config/avr/lib2-object.mk,$(iter-items)) libgcc-objects += $(patsubst %,%$(objext),$(countlsu_funcs)) diff --git a/libgcc/empty.mk b/libgcc/empty.mk deleted file mode 100644 index 7b1d97b..0000000 --- a/libgcc/empty.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Empty. This file exists to suppress errors in the parent Makefile -# when a variable (e.g. LIB2ADD) is empty. -- cgit v1.1 From 4543acc87455646f2a910fe7a3322395a45255f0 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 24 Jun 2020 00:16:31 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 6 ++++++ libgcc/config/avr/libf7/ChangeLog | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 8d36724..fab5078 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2020-06-23 David Edelsohn + + * Makefile.in: Remove uses of empty.mk. Use -include. + * config/avr/t-avr: Use -include. + * empty.mk: Delete. + 2020-06-21 David Edelsohn * config.host (extra_parts): Add crtcxa_64 and crtdbase_64. diff --git a/libgcc/config/avr/libf7/ChangeLog b/libgcc/config/avr/libf7/ChangeLog index 1ec4735..62933df 100644 --- a/libgcc/config/avr/libf7/ChangeLog +++ b/libgcc/config/avr/libf7/ChangeLog @@ -1,3 +1,7 @@ +2020-06-23 David Edelsohn + + * t-libf7: Same. + 2020-01-08 Georg-Johann Lay Implement 64-bit double functions. -- cgit v1.1 From 1890f2f0e210ef515c39728c54151372d36dd187 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 18 May 2020 05:58:41 -0700 Subject: 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. --- libgcc/config/i386/cpuinfo.c | 465 +------------------------------------------ libgcc/config/i386/cpuinfo.h | 136 ------------- 2 files changed, 9 insertions(+), 592 deletions(-) delete mode 100644 libgcc/config/i386/cpuinfo.h (limited to 'libgcc') diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index cf5f088..7218952 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -26,7 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "cpuid.h" #include "tsystem.h" #include "auto-target.h" -#include "cpuinfo.h" +#include "common/config/i386/i386-cpuinfo.h" +#include "common/config/i386/cpuinfo.h" #ifdef HAVE_INIT_PRIORITY #define CONSTRUCTOR_PRIORITY (101) @@ -39,386 +40,14 @@ int __cpu_indicator_init (void) struct __processor_model __cpu_model = { }; -#ifndef SHARED /* We want to move away from __cpu_model in libgcc_s.so.1 and the size of __cpu_model is part of ABI. So, new features that don't fit into __cpu_model.__cpu_features[0] go into extra variables - in libgcc.a only, preferrably hidden. */ -unsigned int __cpu_features2; -#endif - - -/* Get the specific type of AMD CPU. */ - -static void -get_amd_cpu (unsigned int family, unsigned int model) -{ - switch (family) - { - /* AMD Family 10h. */ - case 0x10: - __cpu_model.__cpu_type = AMDFAM10H; - switch (model) - { - case 0x2: - /* Barcelona. */ - __cpu_model.__cpu_subtype = AMDFAM10H_BARCELONA; - break; - case 0x4: - /* Shanghai. */ - __cpu_model.__cpu_subtype = AMDFAM10H_SHANGHAI; - break; - case 0x8: - /* Istanbul. */ - __cpu_model.__cpu_subtype = AMDFAM10H_ISTANBUL; - break; - default: - break; - } - break; - /* AMD Family 14h "btver1". */ - case 0x14: - __cpu_model.__cpu_type = AMD_BTVER1; - break; - /* AMD Family 15h "Bulldozer". */ - case 0x15: - __cpu_model.__cpu_type = AMDFAM15H; - - if (model == 0x2) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2; - /* Bulldozer version 1. */ - else if (model <= 0xf) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER1; - /* Bulldozer version 2 "Piledriver" */ - else if (model <= 0x2f) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2; - /* Bulldozer version 3 "Steamroller" */ - else if (model <= 0x4f) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3; - /* Bulldozer version 4 "Excavator" */ - else if (model <= 0x7f) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4; - break; - /* AMD Family 16h "btver2" */ - case 0x16: - __cpu_model.__cpu_type = AMD_BTVER2; - break; - case 0x17: - __cpu_model.__cpu_type = AMDFAM17H; - /* AMD family 17h version 1. */ - if (model <= 0x1f) - __cpu_model.__cpu_subtype = AMDFAM17H_ZNVER1; - if (model >= 0x30) - __cpu_model.__cpu_subtype = AMDFAM17H_ZNVER2; - break; - default: - break; - } -} - -/* Get the specific type of Intel CPU. */ - -static void -get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id) -{ - /* Parse family and model only if brand ID is 0. */ - if (brand_id == 0) - { - switch (family) - { - case 0x5: - /* Pentium. */ - break; - case 0x6: - switch (model) - { - case 0x1c: - case 0x26: - /* Bonnell. */ - __cpu_model.__cpu_type = INTEL_BONNELL; - break; - case 0x37: - case 0x4a: - case 0x4d: - case 0x5a: - case 0x5d: - /* Silvermont. */ - __cpu_model.__cpu_type = INTEL_SILVERMONT; - break; - case 0x5c: - case 0x5f: - /* Goldmont. */ - __cpu_model.__cpu_type = INTEL_GOLDMONT; - break; - case 0x7a: - /* Goldmont Plus. */ - __cpu_model.__cpu_type = INTEL_GOLDMONT_PLUS; - break; - case 0x57: - /* Knights Landing. */ - __cpu_model.__cpu_type = INTEL_KNL; - break; - case 0x85: - /* Knights Mill. */ - __cpu_model.__cpu_type = INTEL_KNM; - break; - case 0x1a: - case 0x1e: - case 0x1f: - case 0x2e: - /* Nehalem. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_NEHALEM; - break; - case 0x25: - case 0x2c: - case 0x2f: - /* Westmere. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_WESTMERE; - break; - case 0x2a: - case 0x2d: - /* Sandy Bridge. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_SANDYBRIDGE; - break; - case 0x3a: - case 0x3e: - /* Ivy Bridge. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_IVYBRIDGE; - break; - case 0x3c: - case 0x3f: - case 0x45: - case 0x46: - /* Haswell. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_HASWELL; - break; - case 0x3d: - case 0x47: - case 0x4f: - case 0x56: - /* Broadwell. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_BROADWELL; - break; - case 0x4e: - case 0x5e: - /* Skylake. */ - case 0x8e: - case 0x9e: - /* Kaby Lake. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE; - break; - case 0x55: - { - unsigned int eax, ebx, ecx, edx; - __cpu_model.__cpu_type = INTEL_COREI7; - __cpuid_count (7, 0, eax, ebx, ecx, edx); - if (ecx & bit_AVX512VNNI) - /* Cascade Lake. */ - __cpu_model.__cpu_subtype = INTEL_COREI7_CASCADELAKE; - else - /* Skylake with AVX-512 support. */ - __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE_AVX512; - } - break; - case 0x66: - /* Cannon Lake. */ - __cpu_model.__cpu_type = INTEL_COREI7; - __cpu_model.__cpu_subtype = INTEL_COREI7_CANNONLAKE; - break; - case 0x17: - case 0x1d: - /* Penryn. */ - case 0x0f: - /* Merom. */ - __cpu_model.__cpu_type = INTEL_CORE2; - break; - default: - break; - } - break; - default: - /* We have no idea. */ - break; - } - } -} - -/* ECX and EDX are output of CPUID at level one. MAX_CPUID_LEVEL is - the max possible level of CPUID insn. */ -static void -get_available_features (unsigned int ecx, unsigned int edx, - int max_cpuid_level) -{ - unsigned int eax, ebx; - unsigned int ext_level; - - unsigned int features = 0; - unsigned int features2 = 0; - - /* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */ -#define XCR_XFEATURE_ENABLED_MASK 0x0 -#define XSTATE_FP 0x1 -#define XSTATE_SSE 0x2 -#define XSTATE_YMM 0x4 -#define XSTATE_OPMASK 0x20 -#define XSTATE_ZMM 0x40 -#define XSTATE_HI_ZMM 0x80 - -#define XCR_AVX_ENABLED_MASK \ - (XSTATE_SSE | XSTATE_YMM) -#define XCR_AVX512F_ENABLED_MASK \ - (XSTATE_SSE | XSTATE_YMM | XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM) - - /* Check if AVX and AVX512 are usable. */ - int avx_usable = 0; - int avx512_usable = 0; - if ((ecx & bit_OSXSAVE)) - { - /* Check if XMM, YMM, OPMASK, upper 256 bits of ZMM0-ZMM15 and - ZMM16-ZMM31 states are supported by OSXSAVE. */ - unsigned int xcrlow; - unsigned int xcrhigh; - asm (".byte 0x0f, 0x01, 0xd0" - : "=a" (xcrlow), "=d" (xcrhigh) - : "c" (XCR_XFEATURE_ENABLED_MASK)); - if ((xcrlow & XCR_AVX_ENABLED_MASK) == XCR_AVX_ENABLED_MASK) - { - avx_usable = 1; - avx512_usable = ((xcrlow & XCR_AVX512F_ENABLED_MASK) - == XCR_AVX512F_ENABLED_MASK); - } - } - -#define set_feature(f) \ - do \ - { \ - if (f < 32) \ - features |= (1U << (f & 31)); \ - else \ - features2 |= (1U << ((f - 32) & 31)); \ - } \ - while (0) - - if (edx & bit_CMOV) - set_feature (FEATURE_CMOV); - if (edx & bit_MMX) - set_feature (FEATURE_MMX); - if (edx & bit_SSE) - set_feature (FEATURE_SSE); - if (edx & bit_SSE2) - set_feature (FEATURE_SSE2); - if (ecx & bit_POPCNT) - set_feature (FEATURE_POPCNT); - if (ecx & bit_AES) - set_feature (FEATURE_AES); - if (ecx & bit_PCLMUL) - set_feature (FEATURE_PCLMUL); - if (ecx & bit_SSE3) - set_feature (FEATURE_SSE3); - if (ecx & bit_SSSE3) - set_feature (FEATURE_SSSE3); - if (ecx & bit_SSE4_1) - set_feature (FEATURE_SSE4_1); - if (ecx & bit_SSE4_2) - set_feature (FEATURE_SSE4_2); - if (avx_usable) - { - if (ecx & bit_AVX) - set_feature (FEATURE_AVX); - if (ecx & bit_FMA) - set_feature (FEATURE_FMA); - } - - /* Get Advanced Features at level 7 (eax = 7, ecx = 0/1). */ - if (max_cpuid_level >= 7) - { - __cpuid_count (7, 0, eax, ebx, ecx, edx); - if (ebx & bit_BMI) - set_feature (FEATURE_BMI); - if (avx_usable) - { - if (ebx & bit_AVX2) - set_feature (FEATURE_AVX2); - if (ecx & bit_VPCLMULQDQ) - set_feature (FEATURE_VPCLMULQDQ); - } - if (ebx & bit_BMI2) - set_feature (FEATURE_BMI2); - if (ecx & bit_GFNI) - set_feature (FEATURE_GFNI); - if (avx512_usable) - { - if (ebx & bit_AVX512F) - set_feature (FEATURE_AVX512F); - if (ebx & bit_AVX512VL) - set_feature (FEATURE_AVX512VL); - if (ebx & bit_AVX512BW) - set_feature (FEATURE_AVX512BW); - if (ebx & bit_AVX512DQ) - set_feature (FEATURE_AVX512DQ); - if (ebx & bit_AVX512CD) - set_feature (FEATURE_AVX512CD); - if (ebx & bit_AVX512PF) - set_feature (FEATURE_AVX512PF); - if (ebx & bit_AVX512ER) - set_feature (FEATURE_AVX512ER); - if (ebx & bit_AVX512IFMA) - set_feature (FEATURE_AVX512IFMA); - if (ecx & bit_AVX512VBMI) - set_feature (FEATURE_AVX512VBMI); - if (ecx & bit_AVX512VBMI2) - set_feature (FEATURE_AVX512VBMI2); - if (ecx & bit_AVX512VNNI) - set_feature (FEATURE_AVX512VNNI); - if (ecx & bit_AVX512BITALG) - set_feature (FEATURE_AVX512BITALG); - if (ecx & bit_AVX512VPOPCNTDQ) - set_feature (FEATURE_AVX512VPOPCNTDQ); - if (edx & bit_AVX5124VNNIW) - set_feature (FEATURE_AVX5124VNNIW); - if (edx & bit_AVX5124FMAPS) - set_feature (FEATURE_AVX5124FMAPS); - if (edx & bit_AVX512VP2INTERSECT) - set_feature (FEATURE_AVX512VP2INTERSECT); + in libgcc.a only, preferably hidden. - __cpuid_count (7, 1, eax, ebx, ecx, edx); - if (eax & bit_AVX512BF16) - set_feature (FEATURE_AVX512BF16); - } - } - - /* Check cpuid level of extended features. */ - __cpuid (0x80000000, ext_level, ebx, ecx, edx); - - if (ext_level >= 0x80000001) - { - __cpuid (0x80000001, eax, ebx, ecx, edx); - - if (ecx & bit_SSE4a) - set_feature (FEATURE_SSE4_A); - if (avx_usable) - { - if (ecx & bit_FMA4) - set_feature (FEATURE_FMA4); - if (ecx & bit_XOP) - set_feature (FEATURE_XOP); - } - } - - __cpu_model.__cpu_features[0] = features; -#ifndef SHARED - __cpu_features2 = features2; -#else - (void) features2; -#endif -} + NB: Since older 386-builtins.c accesses __cpu_features2 as scalar or + smaller array, it can only access the first few elements. */ +unsigned int __cpu_features2[SIZE_OF_CPU_FEATURES]; /* A constructor function that is sets __cpu_model and __cpu_features with the right values. This needs to run only once. This constructor is @@ -429,85 +58,9 @@ get_available_features (unsigned int ecx, unsigned int edx, int __attribute__ ((constructor CONSTRUCTOR_PRIORITY)) __cpu_indicator_init (void) { - unsigned int eax, ebx, ecx, edx; - - int max_level; - unsigned int vendor; - unsigned int model, family, brand_id; - unsigned int extended_model, extended_family; - - /* This function needs to run just once. */ - if (__cpu_model.__cpu_vendor) - return 0; - - /* Assume cpuid insn present. Run in level 0 to get vendor id. */ - if (!__get_cpuid (0, &eax, &ebx, &ecx, &edx)) - { - __cpu_model.__cpu_vendor = VENDOR_OTHER; - return -1; - } - - vendor = ebx; - max_level = eax; - - if (max_level < 1) - { - __cpu_model.__cpu_vendor = VENDOR_OTHER; - return -1; - } - - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - { - __cpu_model.__cpu_vendor = VENDOR_OTHER; - return -1; - } - - model = (eax >> 4) & 0x0f; - family = (eax >> 8) & 0x0f; - brand_id = ebx & 0xff; - extended_model = (eax >> 12) & 0xf0; - extended_family = (eax >> 20) & 0xff; - - if (vendor == signature_INTEL_ebx) - { - /* Adjust model and family for Intel CPUS. */ - if (family == 0x0f) - { - family += extended_family; - model += extended_model; - } - else if (family == 0x06) - model += extended_model; - - /* Get CPU type. */ - get_intel_cpu (family, model, brand_id); - /* Find available features. */ - get_available_features (ecx, edx, max_level); - __cpu_model.__cpu_vendor = VENDOR_INTEL; - } - else if (vendor == signature_AMD_ebx) - { - /* Adjust model and family for AMD CPUS. */ - if (family == 0x0f) - { - family += extended_family; - model += extended_model; - } - - /* Get CPU type. */ - get_amd_cpu (family, model); - /* Find available features. */ - get_available_features (ecx, edx, max_level); - __cpu_model.__cpu_vendor = VENDOR_AMD; - } - else - __cpu_model.__cpu_vendor = VENDOR_OTHER; - - gcc_assert (__cpu_model.__cpu_vendor < VENDOR_MAX); - gcc_assert (__cpu_model.__cpu_type < CPU_TYPE_MAX); - gcc_assert (__cpu_model.__cpu_subtype < CPU_SUBTYPE_MAX); - - return 0; + struct __processor_model2 cpu_model2; + return cpu_indicator_init (&__cpu_model, &cpu_model2, + __cpu_features2); } #if defined SHARED && defined USE_ELF_SYMVER diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h deleted file mode 100644 index 0f97510..0000000 --- a/libgcc/config/i386/cpuinfo.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Get CPU type and Features for x86 processors. - Copyright (C) 2012-2020 Free Software Foundation, Inc. - Contributed by Sriraman Tallam (tmsriram@google.com) - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -Under Section 7 of GPL version 3, you are granted additional -permissions described in the GCC Runtime Library Exception, version -3.1, as published by the Free Software Foundation. - -You should have received a copy of the GNU General Public License and -a copy of the GCC Runtime Library Exception along with this program; -see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -. */ - -/* Processor Vendor and Models. */ - -enum processor_vendor -{ - VENDOR_INTEL = 1, - VENDOR_AMD, - VENDOR_OTHER, - VENDOR_MAX -}; - -/* Any new types or subtypes have to be inserted at the end. */ - -enum processor_types -{ - INTEL_BONNELL = 1, - INTEL_CORE2, - INTEL_COREI7, - AMDFAM10H, - AMDFAM15H, - INTEL_SILVERMONT, - INTEL_KNL, - AMD_BTVER1, - AMD_BTVER2, - AMDFAM17H, - INTEL_KNM, - INTEL_GOLDMONT, - INTEL_GOLDMONT_PLUS, - INTEL_TREMONT, - CPU_TYPE_MAX -}; - -enum processor_subtypes -{ - INTEL_COREI7_NEHALEM = 1, - INTEL_COREI7_WESTMERE, - INTEL_COREI7_SANDYBRIDGE, - AMDFAM10H_BARCELONA, - AMDFAM10H_SHANGHAI, - AMDFAM10H_ISTANBUL, - AMDFAM15H_BDVER1, - AMDFAM15H_BDVER2, - AMDFAM15H_BDVER3, - AMDFAM15H_BDVER4, - AMDFAM17H_ZNVER1, - INTEL_COREI7_IVYBRIDGE, - INTEL_COREI7_HASWELL, - INTEL_COREI7_BROADWELL, - INTEL_COREI7_SKYLAKE, - INTEL_COREI7_SKYLAKE_AVX512, - INTEL_COREI7_CANNONLAKE, - INTEL_COREI7_ICELAKE_CLIENT, - INTEL_COREI7_ICELAKE_SERVER, - AMDFAM17H_ZNVER2, - INTEL_COREI7_CASCADELAKE, - INTEL_COREI7_TIGERLAKE, - INTEL_COREI7_COOPERLAKE, - CPU_SUBTYPE_MAX -}; - -/* ISA Features supported. New features have to be inserted at the end. */ - -enum processor_features -{ - FEATURE_CMOV = 0, - FEATURE_MMX, - FEATURE_POPCNT, - FEATURE_SSE, - FEATURE_SSE2, - FEATURE_SSE3, - FEATURE_SSSE3, - FEATURE_SSE4_1, - FEATURE_SSE4_2, - FEATURE_AVX, - FEATURE_AVX2, - FEATURE_SSE4_A, - FEATURE_FMA4, - FEATURE_XOP, - FEATURE_FMA, - FEATURE_AVX512F, - FEATURE_BMI, - FEATURE_BMI2, - FEATURE_AES, - FEATURE_PCLMUL, - FEATURE_AVX512VL, - FEATURE_AVX512BW, - FEATURE_AVX512DQ, - FEATURE_AVX512CD, - FEATURE_AVX512ER, - FEATURE_AVX512PF, - FEATURE_AVX512VBMI, - FEATURE_AVX512IFMA, - FEATURE_AVX5124VNNIW, - FEATURE_AVX5124FMAPS, - FEATURE_AVX512VPOPCNTDQ, - FEATURE_AVX512VBMI2, - FEATURE_GFNI, - FEATURE_VPCLMULQDQ, - FEATURE_AVX512VNNI, - FEATURE_AVX512BITALG, - FEATURE_AVX512BF16, - FEATURE_AVX512VP2INTERSECT -}; - -extern struct __processor_model -{ - unsigned int __cpu_vendor; - unsigned int __cpu_type; - unsigned int __cpu_subtype; - unsigned int __cpu_features[1]; -} __cpu_model; -extern unsigned int __cpu_features2; -- cgit v1.1 From acba4660b4c30354c586ea8ae9fc40ccf53bd6e3 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Wed, 24 Jun 2020 10:10:56 -0400 Subject: Fix typo in ChangeLog --- libgcc/config/avr/libf7/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/config/avr/libf7/ChangeLog b/libgcc/config/avr/libf7/ChangeLog index 62933df..d24215e 100644 --- a/libgcc/config/avr/libf7/ChangeLog +++ b/libgcc/config/avr/libf7/ChangeLog @@ -1,6 +1,6 @@ 2020-06-23 David Edelsohn - * t-libf7: Same. + * t-libf7: Use -include. 2020-01-08 Georg-Johann Lay -- cgit v1.1 From 2e546c261beddd649e92925373e1c54aec3299a0 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 25 Jun 2020 00:16:30 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index fab5078..9678abd 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,16 @@ +2020-06-24 H.J. Lu + + 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-23 David Edelsohn * Makefile.in: Remove uses of empty.mk. Use -include. -- cgit v1.1 From 88891c5ff0e3e20d3dd743c4eb6cc45399ee5c33 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 25 Jun 2020 11:20:52 +0200 Subject: 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. --- libgcc/libgcov-driver.c | 26 +++++++++++--------------- libgcc/libgcov-util.c | 11 ++++++----- libgcc/libgcov.h | 1 + 3 files changed, 18 insertions(+), 20 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index cbfcae9..871b87b 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -442,19 +442,6 @@ write_one_data (const struct gcov_info *gi_ptr, gcov_write_unsigned (0); } -/* Helper function for merging summary. */ - -static void -merge_summary (int run_counted, struct gcov_summary *summary, - gcov_type run_max) -{ - if (!run_counted) - { - summary->runs++; - summary->sum_max += run_max; - } -} - /* Dump the coverage counts for one gcov_info object. We merge with existing counts when possible, to avoid growing the .da files ad infinitum. We use this program's checksum to make sure we only accumulate whole program @@ -464,7 +451,8 @@ merge_summary (int run_counted, struct gcov_summary *summary, static void dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, - unsigned run_counted, gcov_type run_max) + unsigned run_counted ATTRIBUTE_UNUSED, + gcov_type run_max ATTRIBUTE_UNUSED) { struct gcov_summary summary = {}; int error; @@ -492,7 +480,15 @@ dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, gcov_rewrite (); - merge_summary (run_counted, &summary, run_max); +#if !IN_GCOV_TOOL + if (!run_counted) + { + summary.runs++; + summary.sum_max += run_max; + } +#else + summary = gi_ptr->summary; +#endif write_one_data (gi_ptr, &summary); /* fall through */ diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 224c190..09e34f0 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -80,8 +80,6 @@ static int k_ctrs_mask[GCOV_COUNTERS]; static struct gcov_ctr_info k_ctrs[GCOV_COUNTERS]; /* Number of kind of counters that have been seen. */ static int k_ctrs_types; -/* The object summary being processed. */ -static struct gcov_summary *curr_object_summary; /* Merge functions for counters. */ #define DEF_GCOV_COUNTER(COUNTER, NAME, FN_TYPE) __gcov_merge ## FN_TYPE, @@ -225,8 +223,7 @@ tag_counters (unsigned tag, unsigned length) static void tag_summary (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) { - curr_object_summary = (gcov_summary *) xcalloc (sizeof (gcov_summary), 1); - gcov_read_summary (curr_object_summary); + gcov_read_summary (&curr_gcov_info->summary); } /* This function is called at the end of reading a gcda file. @@ -300,7 +297,6 @@ read_gcda_file (const char *filename) obstack_init (&fn_info); num_fn_info = 0; curr_fn_info = 0; - curr_object_summary = NULL; { size_t len = strlen (filename) + 1; char *str_dup = (char*) xmalloc (len); @@ -584,6 +580,11 @@ gcov_merge (struct gcov_info *info1, struct gcov_info *info2, int w) int has_mismatch = 0; gcc_assert (info2->n_functions == n_functions); + + /* Merge summary. */ + info1->summary.runs += info2->summary.runs; + info1->summary.sum_max += info2->summary.sum_max; + for (f_ix = 0; f_ix < n_functions; f_ix++) { unsigned t_ix; diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index ffa9a69..81e1895 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -217,6 +217,7 @@ struct gcov_info to function information */ #else struct gcov_fn_info **functions; + struct gcov_summary summary; #endif /* !IN_GCOV_TOOL */ }; -- cgit v1.1 From d61ffe124430160c4da7516596d6a4dbcdf2a7a6 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 26 Jun 2020 00:16:23 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 9678abd..d6367e2 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,14 @@ +2020-06-25 Martin Liska + + * 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-24 H.J. Lu PR target/95259 -- cgit v1.1 From ece21ff6ea9d969d3b6aae82136622a7126eefc1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 2 Jun 2020 10:11:07 +0200 Subject: 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. --- libgcc/libgcov-driver.c | 44 ++++++++++++++++++++++++++++++-------------- libgcc/libgcov-util.c | 41 ++++++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 33 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index 871b87b..2590593 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -302,13 +302,16 @@ merge_one_data (const char *filename, continue; tag = gcov_read_unsigned (); - length = gcov_read_unsigned (); + int read_length = (int)gcov_read_unsigned (); + length = abs (read_length); if (tag != GCOV_TAG_FOR_COUNTER (t_ix) || (length != GCOV_TAG_COUNTER_LENGTH (ci_ptr->num) && t_ix != GCOV_COUNTER_V_TOPN && t_ix != GCOV_COUNTER_V_INDIR)) goto read_mismatch; - (*merge) (ci_ptr->values, ci_ptr->num); + /* Merging with all zero counters does not make sense. */ + if (read_length > 0) + (*merge) (ci_ptr->values, ci_ptr->num); ci_ptr++; } if ((error = gcov_is_error ())) @@ -414,27 +417,40 @@ write_one_data (const struct gcov_info *gi_ptr, ci_ptr = gfi_ptr->ctrs; for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++) { - gcov_unsigned_t n_counts; - gcov_type *c_ptr; + gcov_position_t n_counts; - if (!gi_ptr->merge[t_ix]) - continue; + if (!gi_ptr->merge[t_ix]) + continue; - n_counts = ci_ptr->num; + n_counts = ci_ptr->num; if (gi_ptr->merge[t_ix] == __gcov_merge_topn) write_top_counters (ci_ptr, t_ix, n_counts); else { - gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), - GCOV_TAG_COUNTER_LENGTH (n_counts)); - c_ptr = ci_ptr->values; - while (n_counts--) - gcov_write_counter (*c_ptr++); + /* Do not stream when all counters are zero. */ + int all_zeros = 1; + for (unsigned i = 0; i < n_counts; i++) + if (ci_ptr->values[i] != 0) + { + all_zeros = 0; + break; + } + + if (all_zeros) + gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), + GCOV_TAG_COUNTER_LENGTH (-n_counts)); + else + { + gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix), + GCOV_TAG_COUNTER_LENGTH (n_counts)); + for (unsigned i = 0; i < n_counts; i++) + gcov_write_counter (ci_ptr->values[i]); + } } - ci_ptr++; - } + ci_ptr++; + } if (buffered) fn_buffer = free_fn_data (gi_ptr, fn_buffer, GCOV_COUNTERS); } diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 09e34f0..1ada1fe 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -57,12 +57,12 @@ void gcov_set_verbose (void) #include #endif -static void tag_function (unsigned, unsigned); -static void tag_blocks (unsigned, unsigned); -static void tag_arcs (unsigned, unsigned); -static void tag_lines (unsigned, unsigned); -static void tag_counters (unsigned, unsigned); -static void tag_summary (unsigned, unsigned); +static void tag_function (unsigned, int); +static void tag_blocks (unsigned, int); +static void tag_arcs (unsigned, int); +static void tag_lines (unsigned, int); +static void tag_counters (unsigned, int); +static void tag_summary (unsigned, int); /* The gcov_info for the first module. */ static struct gcov_info *curr_gcov_info; @@ -117,7 +117,7 @@ typedef struct tag_format { unsigned tag; char const *name; - void (*proc) (unsigned, unsigned); + void (*proc) (unsigned, int); } tag_format_t; /* Handler table for various Tags. */ @@ -138,7 +138,7 @@ static const tag_format_t tag_table[] = /* Handler for reading function tag. */ static void -tag_function (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) +tag_function (unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { int i; @@ -171,7 +171,7 @@ tag_function (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) /* Handler for reading block tag. */ static void -tag_blocks (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) +tag_blocks (unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { /* TBD: gcov-tool currently does not handle gcno files. Assert here. */ gcc_unreachable (); @@ -180,7 +180,7 @@ tag_blocks (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) /* Handler for reading flow arc tag. */ static void -tag_arcs (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) +tag_arcs (unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { /* TBD: gcov-tool currently does not handle gcno files. Assert here. */ gcc_unreachable (); @@ -189,7 +189,7 @@ tag_arcs (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) /* Handler for reading line tag. */ static void -tag_lines (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) +tag_lines (unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED) { /* TBD: gcov-tool currently does not handle gcno files. Assert here. */ gcc_unreachable (); @@ -198,9 +198,9 @@ tag_lines (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) /* Handler for reading counters array tag with value as TAG and length of LENGTH. */ static void -tag_counters (unsigned tag, unsigned length) +tag_counters (unsigned tag, int length) { - unsigned n_counts = GCOV_TAG_COUNTER_NUM (length); + unsigned n_counts = GCOV_TAG_COUNTER_NUM (abs (length)); gcov_type *values; unsigned ix; unsigned tag_ix; @@ -211,17 +211,19 @@ tag_counters (unsigned tag, unsigned length) gcc_assert (k_ctrs[tag_ix].num == 0); k_ctrs[tag_ix].num = n_counts; - k_ctrs[tag_ix].values = values = (gcov_type *) xmalloc (n_counts * sizeof (gcov_type)); + k_ctrs[tag_ix].values = values = (gcov_type *) xcalloc (sizeof (gcov_type), + n_counts); gcc_assert (values); - for (ix = 0; ix != n_counts; ix++) - values[ix] = gcov_read_counter (); + if (length > 0) + for (ix = 0; ix != n_counts; ix++) + values[ix] = gcov_read_counter (); } /* Handler for reading summary tag. */ static void -tag_summary (unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED) +tag_summary (unsigned tag ATTRIBUTE_UNUSED, int ATTRIBUTE_UNUSED) { gcov_read_summary (&curr_gcov_info->summary); } @@ -320,7 +322,8 @@ read_gcda_file (const char *filename) tag = gcov_read_unsigned (); if (!tag) break; - length = gcov_read_unsigned (); + int read_length = (int)gcov_read_unsigned (); + length = read_length > 0 ? read_length : 0; base = gcov_position (); mask = GCOV_TAG_MASK (tag) >> 1; for (tag_depth = 4; mask; mask >>= 8) @@ -353,7 +356,7 @@ read_gcda_file (const char *filename) { unsigned long actual_length; - (*format->proc) (tag, length); + (*format->proc) (tag, read_length); actual_length = gcov_position () - base; if (actual_length > length) -- cgit v1.1 From b5f24739632389d50903bfde6d1bfc06d522c56b Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 3 Jul 2020 00:16:25 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d6367e2..7ab77a0 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,19 @@ +2020-07-02 Martin Liska + + 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-06-25 Martin Liska * libgcov-driver.c (merge_summary): Remove function as its name -- cgit v1.1 From e73ec755489afc9fcc75dfac6f06ac73e243e72a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 3 Jul 2020 14:11:49 +0100 Subject: 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 libgcc/ChangeLog: * config/aarch64/lse.S: Add stack note. --- libgcc/config/aarch64/lse.S | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libgcc') diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S index f3ccf5c..9e2acae 100644 --- a/libgcc/config/aarch64/lse.S +++ b/libgcc/config/aarch64/lse.S @@ -274,3 +274,7 @@ STARTFN NAME(LDNM) ENDFN NAME(LDNM) #endif + +#if defined(__linux__) || defined(__FreeBSD__) +.section .note.GNU-stack, "", %progbits +#endif -- cgit v1.1 From f0f62fa0320762119446893c67cb52934bc5a05e Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 2 Jul 2020 17:11:56 +0100 Subject: 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 libgcc/ChangeLog: PR target/96001 * config/aarch64/lse.S: Add BTI marking and related definitions, and add BTI c to function entries. --- libgcc/config/aarch64/lse.S | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libgcc') diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S index 9e2acae..64691c6 100644 --- a/libgcc/config/aarch64/lse.S +++ b/libgcc/config/aarch64/lse.S @@ -136,6 +136,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define tmp1 17 #define tmp2 15 +#define BTI_C hint 34 + /* Start and end a function. */ .macro STARTFN name .text @@ -145,6 +147,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .type \name, %function .cfi_startproc \name: + BTI_C .endm .macro ENDFN name @@ -275,6 +278,29 @@ STARTFN NAME(LDNM) ENDFN NAME(LDNM) #endif +/* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */ +#define FEATURE_1_AND 0xc0000000 +#define FEATURE_1_BTI 1 +#define FEATURE_1_PAC 2 + +/* Add a NT_GNU_PROPERTY_TYPE_0 note. */ +#define GNU_PROPERTY(type, value) \ + .section .note.gnu.property, "a"; \ + .p2align 3; \ + .word 4; \ + .word 16; \ + .word 5; \ + .asciz "GNU"; \ + .word type; \ + .word 4; \ + .word value; \ + .word 0; + #if defined(__linux__) || defined(__FreeBSD__) .section .note.GNU-stack, "", %progbits + +/* Add GNU property note if built with branch protection. */ +# ifdef __ARM_FEATURE_BTI_DEFAULT +GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI) +# endif #endif -- cgit v1.1 From 3f8ca9cb86aae8f3742736d3c0ee11d4d1761a48 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 10 Jul 2020 00:16:28 +0000 Subject: Daily bump. --- libgcc/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7ab77a0..602c907 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2020-07-09 Szabolcs Nagy + + PR target/96001 + * config/aarch64/lse.S: Add BTI marking and related definitions, + and add BTI c to function entries. + +2020-07-09 Szabolcs Nagy + + * config/aarch64/lse.S: Add stack note. + 2020-07-02 Martin Liska PR gcov-profile/95348 -- cgit v1.1