diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-11-10 07:26:18 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-11-10 07:26:18 -0800 |
commit | 8d703821c69062c0cd255787d793e44f1a95d463 (patch) | |
tree | 6b1df9cdc36cc47b6164db69a14bc86a63dc77c6 /libgcc | |
parent | 9cd320ea6572c577cdf17ce1f9ea5230b166af6d (diff) | |
parent | cf392dbdf17e38026f8e3c0e9af7f5b87f63be56 (diff) | |
download | gcc-8d703821c69062c0cd255787d793e44f1a95d463.zip gcc-8d703821c69062c0cd255787d793e44f1a95d463.tar.gz gcc-8d703821c69062c0cd255787d793e44f1a95d463.tar.bz2 |
Merge from trunk revision cf392dbdf17e38026f8e3c0e9af7f5b87f63be56.
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 107 | ||||
-rw-r--r-- | libgcc/config.host | 20 | ||||
-rw-r--r-- | libgcc/config/gthr-vxworks-cond.c | 11 | ||||
-rw-r--r-- | libgcc/config/gthr-vxworks-thread.c | 58 | ||||
-rw-r--r-- | libgcc/config/gthr-vxworks-tls.c | 22 | ||||
-rw-r--r-- | libgcc/config/gthr-vxworks.c | 1 | ||||
-rw-r--r-- | libgcc/config/gthr-vxworks.h | 14 | ||||
-rw-r--r-- | libgcc/config/libbid/ChangeLog | 5 | ||||
-rw-r--r-- | libgcc/config/libbid/bid_functions.h | 2 | ||||
-rw-r--r-- | libgcc/config/t-vxcrtstuff | 12 | ||||
-rw-r--r-- | libgcc/config/t-vxworks | 1 | ||||
-rw-r--r-- | libgcc/config/t-vxworks7 | 1 | ||||
-rwxr-xr-x | libgcc/configure | 4 | ||||
-rw-r--r-- | libgcc/configure.ac | 4 | ||||
-rw-r--r-- | libgcc/libgcov.h | 24 | ||||
-rw-r--r-- | libgcc/unwind-seh.c | 5 |
16 files changed, 239 insertions, 52 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 83332b7..fa70f2f7 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,110 @@ +2020-11-03 Pat Bernardi <bernardi@adacore.com> + Olivier Hainque <hainque@adacore.com> + + * config.host (aarch64-vxworks7*, tmake_file): Add + ${cpu_type}/t-lse and t-slibgcc-libgcc. + +2020-11-03 Martin Storsjö <martin@martin.st> + + * unwind-seh.c (_Unwind_Backtrace): Set the ra and cfa pointers + before calling the callback. + +2020-10-30 Olivier Hainque <hainque@adacore.com> + Douglas Rupp <rupp@adacore.com> + Pat Bernardi <bernardi@adacore.com> + + * config.host: Adjust the ix86/x86_64-wrs-vxworks filters + to apply to VxWorks 7 as well. + +2020-10-29 Olivier Hainque <hainque@adacore.com> + + * config/gthr-vxworks-tls.c: Fix preprocessor logic + controlling the definition of VX_ENTER_TLS_DTOR and + VX_LEAVE_TLS_DTOR based on a version major check. + +2020-10-29 Olivier Hainque <hainque@adacore.com> + + * config/gthr-vxworks-thread.c: Fix name of macro used + to condition the inclusion of an actual implementation. + +2020-10-27 Martin Liska <mliska@suse.cz> + + PR gcov-profile/97461 + * libgcov.h (gcov_counter_add): Use first static counters + as it should help to have malloc wrappers set up. + +2020-10-23 Rasmus Villemoes <rv@rasmusvillemoes.dk> + + * config/gthr-vxworks-thread.c: #include gthr.h before + testing the guard defined there. + * config/gthr-vxworks-cond.c: Likewise. + +2020-10-21 Douglas Rupp <rupp@adacore.com> + Olivier Hainque <hainque@adacore.com> + + * config.host (powerpc*-wrs-vxworks7*): New case. + * configure.ac: Handle powerpc*-*-vxworks7* as + powerpc*-*-linux* for ppc-fp_type. + * configure: Regenerate. + +2020-10-16 Rasmus Villemoes <rv@rasmusvillemoes.dk> + + * config/gthr-vxworks.h: Condition the ___GTHREADS_CXX0X + section on VxWorks >= 6. + * config/gthr-vxworks-thread.c: Condition the entire + implementation on __GTHREAD_CXX0X. + +2020-10-16 Rasmus Villemoes <rv@rasmusvillemoes.dk> + + * config/gthr-vxworks.h: Condition the __GTHREAD_HAS_COND + section on VxWorks >= 6. + * config/gthr-vxworks-cond.c: Condition the entire + implementation on __GTHREAD_HAS_COND. + +2020-10-16 Rasmus Villemoes <rv@rasmusvillemoes.dk> + + * config/gthr-vxworks.c: #include <taskLib.h>. + +2020-10-16 Rasmus Villemoes <rv@rasmusvillemoes.dk> + + * config/gthr-vxworks.h: Rewrite remaining occurrence + of _VXW_PRE_69 as _VXWORKS_PRE(6,9). + +2020-10-16 Rasmus Villemoes <rv@rasmusvillemoes.dk> + Olivier Hainque <hainque@adacore.com> + + * config/gthr-vxworks-tls.c (VX_ENTER_TLS_DTOR): Nil + except on VxWorks 6. + +2020-10-16 Olivier Hainque <hainque@adacore.com> + + * config/t-vxcrtstuff: Remove the -kernel/-rtp specialization. + +2020-10-14 Alexandre Oliva <oliva@adacore.com> + + * config/gthr-vxworks-thread.c: Include stdlib.h. + (tls_delete_hook): Prototype it. + (__gthread_cond_signal): Return early if no waiters. Consume + signal in case the semaphore got full. Use semInfoGet instead + of kernel-mode-only semInfo. + (__gthread_cond_timedwait): Use semExchange. Always take the + mutex again before returning. + * config/gthr-vxworks-cond.c (__ghtread_cond_wait): Likewise. + +2020-10-14 Olivier Hainque <hainque@adacore.com> + + * config/t-vxworks (LIBGCC2_INCLUDES): Append + $(MULTISUBDIR) to the -I path for fixed headers, as we + arrange to have different sets of such headers for different + multilibs when they are activated. + * config/t-vxworks7: Likewise. + +2020-10-14 Olivier Hainque <hainque@adacore.com> + + * config/t-vxworks: Add include-fixed to include search + paths for libgcc on VxWorks. + * config/t-vxworks7: Likewise. + 2020-10-09 H.J. Lu <hjl.tools@gmail.com> PR target/97148 diff --git a/libgcc/config.host b/libgcc/config.host index dbb378f..66af834 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -393,6 +393,7 @@ aarch64*-*-vxworks7*) extra_parts="$extra_parts crtfastmath.o" md_unwind_header=aarch64/aarch64-unwind.h tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc" tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" ;; alpha*-*-linux*) @@ -774,7 +775,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2*) tm_file="${tm_file} i386/elf-lib.h" md_unwind_header=i386/sol2-unwind.h ;; -i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae|i[4567]86-wrs-vxworks7|x86_64-wrs-vxworks7) +i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks*) ;; i[34567]86-*-cygwin*) extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o" @@ -1226,6 +1227,23 @@ powerpc*-*-linux*) extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o" md_unwind_header=rs6000/linux-unwind.h ;; +powerpc*-wrs-vxworks7*) + tmake_file="$tmake_file rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-linux t-dfprules config/rs6000/t-ppc64-fp t-slibgcc-libgcc" + case $ppc_fp_type in + 64) + ;; + hard) + tmake_file="${tmake_file} t-hardfp-sfdf" + ;; + soft) + tmake_file="${tmake_file} t-softfp-sfdf t-softfp" + ;; + *) + echo "Unknown ppc_fp_type $ppc_fp_type" 1>&2 + exit 1 + ;; + esac + ;; powerpc-wrs-vxworks*) tmake_file="$tmake_file rs6000/t-ppccomm rs6000/t-savresfgpr t-fdpbit" extra_parts="$extra_parts crtbegin.o crtend.o" diff --git a/libgcc/config/gthr-vxworks-cond.c b/libgcc/config/gthr-vxworks-cond.c index d65d07a..e307bea 100644 --- a/libgcc/config/gthr-vxworks-cond.c +++ b/libgcc/config/gthr-vxworks-cond.c @@ -27,6 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see exposed by gthr-vxworks.h. */ #include "gthr.h" + +#if __GTHREAD_HAS_COND + #include <taskLib.h> /* --------------------------- Condition Variables ------------------------ */ @@ -66,13 +69,11 @@ __gthread_cond_wait (__gthread_cond_t *cond, if (!mutex) return ERROR; - __RETURN_ERRNO_IF_NOT_OK (semGive (*mutex)); - - __RETURN_ERRNO_IF_NOT_OK (semTake (*cond, WAIT_FOREVER)); + int ret = __CHECK_RESULT (semExchange (*mutex, *cond, WAIT_FOREVER)); __RETURN_ERRNO_IF_NOT_OK (semTake (*mutex, WAIT_FOREVER)); - return OK; + return ret; } int @@ -81,3 +82,5 @@ __gthread_cond_wait_recursive (__gthread_cond_t *cond, { return __gthread_cond_wait (cond, mutex); } + +#endif diff --git a/libgcc/config/gthr-vxworks-thread.c b/libgcc/config/gthr-vxworks-thread.c index 8544b03..c8fe65f 100644 --- a/libgcc/config/gthr-vxworks-thread.c +++ b/libgcc/config/gthr-vxworks-thread.c @@ -28,7 +28,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see VxWorks kernels. */ #include "gthr.h" + +#if __GTHREADS_CXX0X + #include <taskLib.h> +#include <stdlib.h> #define __TIMESPEC_TO_NSEC(timespec) \ ((long long)timespec.tv_sec * 1000000000 + (long long)timespec.tv_nsec) @@ -38,7 +42,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see / 1000000000) #ifdef __RTP__ - void tls_delete_hook (); + void tls_delete_hook (void); #define __CALL_DELETE_HOOK(tcb) tls_delete_hook() #else /* In kernel mode, we need to pass the TCB to task_delete_hook. The TCB is @@ -47,17 +51,55 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define __CALL_DELETE_HOOK(tcb) tls_delete_hook((WIND_TCB *) ((tcb)->task_id)) #endif -/* -------------------- Timed Condition Variables --------------------- */ - int __gthread_cond_signal (__gthread_cond_t *cond) { if (!cond) return ERROR; - return __CHECK_RESULT (semGive (*cond)); + /* If nobody is waiting, skip the semGive altogether: no one can get + in line while we hold the mutex associated with *COND. We could + skip this test altogether, but it's presumed cheaper than going + through the give and take below, and that a signal without a + waiter occurs often enough for the test to be worth it. */ + SEM_INFO info; + memset (&info, 0, sizeof (info)); + __RETURN_ERRNO_IF_NOT_OK (semInfoGet (*cond, &info)); + if (info.numTasks == 0) + return OK; + + int ret = __CHECK_RESULT (semGive (*cond)); + + /* It might be the case, however, that when we called semInfo, there + was a waiter just about to timeout, and by the time we called + semGive, it had already timed out, so our semGive would leave the + *cond semaphore full, so the next caller of wait would pass + through. We don't want that. So, make sure we leave the + semaphore empty. Despite the window in which the semaphore will + be full, this works because: + + - we're holding the mutex, so nobody else can semGive, and any + pending semTakes are actually within semExchange. there might + be others blocked to acquire the mutex, but those are not + relevant for the analysis. + + - if there was another non-timed out waiter, semGive will wake it + up immediately instead of leaving the semaphore full, so the + semTake below will time out, and the semantics are as expected + + - otherwise, if all waiters timed out before the semGive (or if + there weren't any to begin with), our semGive completed leaving + the semaphore full, and our semTake below will consume it + before any other waiter has a change to reach the semExchange, + because we're holding the mutex. */ + if (ret == OK) + semTake (*cond, NO_WAIT); + + return ret; } +/* -------------------- Timed Condition Variables --------------------- */ + int __gthread_cond_timedwait (__gthread_cond_t *cond, __gthread_mutex_t *mutex, @@ -93,13 +135,11 @@ __gthread_cond_timedwait (__gthread_cond_t *cond, if (waiting_ticks > INT_MAX) waiting_ticks = INT_MAX; - __RETURN_ERRNO_IF_NOT_OK (semGive (*mutex)); - - __RETURN_ERRNO_IF_NOT_OK (semTake (*cond, waiting_ticks)); + int ret = __CHECK_RESULT (semExchange (*mutex, *cond, waiting_ticks)); __RETURN_ERRNO_IF_NOT_OK (semTake (*mutex, WAIT_FOREVER)); - return OK; + return ret; } /* --------------------------- Timed Mutexes ------------------------------ */ @@ -347,3 +387,5 @@ __gthread_detach (__gthread_t __threadid) return OK; } + +#endif diff --git a/libgcc/config/gthr-vxworks-tls.c b/libgcc/config/gthr-vxworks-tls.c index fac25e3..1d5c4fb 100644 --- a/libgcc/config/gthr-vxworks-tls.c +++ b/libgcc/config/gthr-vxworks-tls.c @@ -94,7 +94,9 @@ static int self_owner; static volatile int delete_hook_installed; /* TLS data access internal API. A straight __thread variable starting with - VxWorks 7, a pointer returned by kernel provided routines otherwise. */ + VxWorks 7, a pointer returned by kernel provided routines otherwise. And + on VxWorks 6, the kernel expects us to notify entry/exit of regions + handling such variables by calls to kernel provided __gthread routines. */ #if _VXWORKS_MAJOR_GE(7) @@ -103,23 +105,29 @@ static __thread struct tls_data *__gthread_tls_data; #define VX_GET_TLS_DATA() __gthread_tls_data #define VX_SET_TLS_DATA(x) __gthread_tls_data = (x) -#define VX_ENTER_TLS_DTOR() -#define VX_LEAVE_TLS_DTOR() - #else extern void *__gthread_get_tls_data (void); extern void __gthread_set_tls_data (void *data); -extern void __gthread_enter_tls_dtor_context (void); -extern void __gthread_leave_tls_dtor_context (void); - #define VX_GET_TLS_DATA() __gthread_get_tls_data() #define VX_SET_TLS_DATA(x) __gthread_set_tls_data(x) +#endif + +#if _VXWORKS_MAJOR_EQ(6) + +extern void __gthread_enter_tls_dtor_context (void); +extern void __gthread_leave_tls_dtor_context (void); + #define VX_ENTER_TLS_DTOR() __gthread_enter_tls_dtor_context () #define VX_LEAVE_TLS_DTOR() __gthread_leave_tls_dtor_context () +#else + +#define VX_ENTER_TLS_DTOR() +#define VX_LEAVE_TLS_DTOR() + #endif /* This is a global structure which records all of the active keys. diff --git a/libgcc/config/gthr-vxworks.c b/libgcc/config/gthr-vxworks.c index 9b47ec8..4e73108 100644 --- a/libgcc/config/gthr-vxworks.c +++ b/libgcc/config/gthr-vxworks.c @@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined(__GTHREADS) #include <vxWorks.h> +#include <taskLib.h> #ifndef __RTP__ # include <vxLib.h> diff --git a/libgcc/config/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h index 8b55fc5..beedf5e 100644 --- a/libgcc/config/gthr-vxworks.h +++ b/libgcc/config/gthr-vxworks.h @@ -234,6 +234,12 @@ extern int __gthread_setspecific (__gthread_key_t __key, void *__ptr); /* ------------------ Base condition variables support ------------------- */ +/* VxWorks prio to 6 misses a few services key to a correct + implementation of condition variables with reasonable complexity. + semExchange in particular. */ + +#if _VXWORKS_MAJOR_GE(6) + #define __GTHREAD_HAS_COND 1 typedef SEM_ID __gthread_cond_t; @@ -254,12 +260,14 @@ extern int __gthread_cond_wait (__gthread_cond_t *cond, extern int __gthread_cond_wait_recursive (__gthread_cond_t *cond, __gthread_recursive_mutex_t *mutex); +#endif + /* ----------------------- C++0x thread support ------------------------- */ /* We do not support C++0x threads on that VxWorks 653, which we can recognize by VTHREADS being defined. */ -#ifndef VTHREADS +#if _VXWORKS_MAJOR_GE(6) && !defined(VTHREADS) #define __GTHREADS_CXX0X 1 @@ -286,7 +294,7 @@ typedef struct typedef __gthread_tcb *__gthread_t; /* Typedefs specific to different vxworks versions. */ -#if _VXW_PRE_69 +#if _VXWORKS_PRE(6,9) typedef int _Vx_usr_arg_t; #define TASK_ID_NULL ((TASK_ID)NULL) #define SEM_ID_NULL ((SEM_ID)NULL) @@ -322,7 +330,7 @@ extern int __gthread_detach (__gthread_t thread); extern __gthread_t __gthread_self (void); -#endif +#endif /* _VXWORKS_MAJOR_GE(6) && !defined(VTHREADS) */ #ifdef __cplusplus } diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog index a1a9f46..ce4b57e 100644 --- a/libgcc/config/libbid/ChangeLog +++ b/libgcc/config/libbid/ChangeLog @@ -1,3 +1,8 @@ +2020-10-23 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/97164 + * bid_functions.h (UINT192): Decrease alignment to 8 bytes. + 2020-05-05 Martin Liska <mliska@suse.cz> PR libgcc/92565 diff --git a/libgcc/config/libbid/bid_functions.h b/libgcc/config/libbid/bid_functions.h index 05f9566..d0f0cb2 100644 --- a/libgcc/config/libbid/bid_functions.h +++ b/libgcc/config/libbid/bid_functions.h @@ -81,7 +81,7 @@ ALIGN (16) #define SQRT80 sqrtw #endif - typedef ALIGN (16) + typedef ALIGN (8) struct { UINT64 w[3]; } UINT192; diff --git a/libgcc/config/t-vxcrtstuff b/libgcc/config/t-vxcrtstuff index 96b7285..ef64951 100644 --- a/libgcc/config/t-vxcrtstuff +++ b/libgcc/config/t-vxcrtstuff @@ -1,12 +1,12 @@ -# crtbegin/crtend for VxWorks (DKM or RTP) +# crtbegin/crtend for VxWorks -vx_crtbegin-kernel.o: $(srcdir)/config/vxcrtstuff.c +vx_crtbegin.o: $(srcdir)/config/vxcrtstuff.c $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_BEGIN -c $< -vx_crtbegin-rtp.o: $(srcdir)/config/vxcrtstuff.c - $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_BEGIN -c $< -mrtp - vx_crtend.o: $(srcdir)/config/vxcrtstuff.c $(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_END -c $< -EXTRA_PARTS += vx_crtbegin-kernel.o vx_crtbegin-rtp.o vx_crtend.o +# We do pretty different things for kernel vs rtp modes, all +# controlled thanks to __RTP__ and (optional) multilibs. + +EXTRA_PARTS += vx_crtbegin.o vx_crtend.o diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks index 757cead..02e2efa 100644 --- a/libgcc/config/t-vxworks +++ b/libgcc/config/t-vxworks @@ -12,6 +12,7 @@ LIB2ADD += $(srcdir)/config/vxcache.c # prevail (e.g. unwind.h), and that gcc provided header files intended # to be user visible eventually are visible as well. LIBGCC2_INCLUDES = -nostdinc -I. \ + -I$(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \ -I$(MULTIBUILDTOP)../../gcc/include \ `case "/$(MULTIDIR)" in \ */mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \ diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7 index f2cc904..20c72f4 100644 --- a/libgcc/config/t-vxworks7 +++ b/libgcc/config/t-vxworks7 @@ -12,6 +12,7 @@ LIB2ADD += $(srcdir)/config/vxcache.c # prevail (e.g. unwind.h), and that gcc provided header files intended # to be user visible eventually are visible as well. LIBGCC2_INCLUDES = -nostdinc -I. \ + -I$(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \ -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \ -I$(MULTIBUILDTOP)../../gcc/include \ `case "/$(MULTIDIR)" in \ diff --git a/libgcc/configure b/libgcc/configure index 284e4db..78fc22a 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5164,11 +5164,11 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibc_version_major.$glibc_version_minor" >&5 $as_echo "$glibc_version_major.$glibc_version_minor" >&6; } -# Determine floating-point type for powerpc*-*-linux*. +# Determine floating-point type for powerpc*-*-linux* or vxworks7*. # Single-precision-only FPRs are not a supported configuration for # this target, so are not allowed for in this test. case ${host} in -powerpc*-*-linux*) +powerpc*-*-linux* | powerpc*-*-vxworks7*) cat > conftest.c <<EOF #ifdef __powerpc64__ ppc_fp_type=64 diff --git a/libgcc/configure.ac b/libgcc/configure.ac index ef0d799..ed50c0e 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -383,11 +383,11 @@ AC_COMPUTE_INT([glibc_version_minor], [__GLIBC_MINOR__], [glibc_version_minor=0])]) AC_MSG_RESULT([$glibc_version_major.$glibc_version_minor]) -# Determine floating-point type for powerpc*-*-linux*. +# Determine floating-point type for powerpc*-*-linux* or vxworks7*. # Single-precision-only FPRs are not a supported configuration for # this target, so are not allowed for in this test. case ${host} in -powerpc*-*-linux*) +powerpc*-*-linux* | powerpc*-*-vxworks7*) cat > conftest.c <<EOF #ifdef __powerpc64__ ppc_fp_type=64 diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 8be5beb..e70cf63 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -404,22 +404,16 @@ gcov_counter_add (gcov_type *counter, gcov_type value, *counter += value; } -/* Allocate gcov_kvp from heap. If we are recursively called, then allocate - it from a list of pre-allocated pool. */ +/* Allocate gcov_kvp from statically pre-allocated pool, + or use heap otherwise. */ static inline struct gcov_kvp * allocate_gcov_kvp (void) { struct gcov_kvp *new_node = NULL; - static -#if defined(HAVE_CC_TLS) -__thread -#endif - volatile unsigned in_recursion ATTRIBUTE_UNUSED = 0; - #if !defined(IN_GCOV_TOOL) && !defined(L_gcov_merge_topn) - if (__builtin_expect (in_recursion, 0)) + if (__gcov_kvp_pool_index < GCOV_PREALLOCATED_KVP) { unsigned index; #if GCOV_SUPPORTS_ATOMIC @@ -430,17 +424,11 @@ __thread #endif if (index < GCOV_PREALLOCATED_KVP) new_node = &__gcov_kvp_pool[index]; - else - /* Do not crash in the situation. */ - return NULL; } - else #endif - { - in_recursion = 1; - new_node = (struct gcov_kvp *)xcalloc (1, sizeof (struct gcov_kvp)); - in_recursion = 0; - } + + if (new_node == NULL) + new_node = (struct gcov_kvp *)xcalloc (1, sizeof (struct gcov_kvp)); return new_node; } diff --git a/libgcc/unwind-seh.c b/libgcc/unwind-seh.c index 1a70180..275d782 100644 --- a/libgcc/unwind-seh.c +++ b/libgcc/unwind-seh.c @@ -466,6 +466,11 @@ _Unwind_Backtrace(_Unwind_Trace_Fn trace, &gcc_context.disp->HandlerData, &gcc_context.disp->EstablisherFrame, NULL); + /* Set values that the callback can inspect via _Unwind_GetIP + * and _Unwind_GetCFA. */ + gcc_context.ra = ms_context.Rip; + gcc_context.cfa = ms_context.Rsp; + /* Call trace function. */ if (trace (&gcc_context, trace_argument) != _URC_NO_REASON) return _URC_FATAL_PHASE1_ERROR; |