From 0a76bba487f54f1036b4b11f1cdc54582191e836 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 26 Sep 2018 17:25:15 +0200 Subject: crtprec.c (set_precision): Use fnstcw instead of fstcw. * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. From-SVN: r264649 --- libgcc/ChangeLog | 4 ++++ libgcc/config/i386/crtprec.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 928b5a8..e08168c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Uros Bizjak + + * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. + 2018-09-21 Alexandre Oliva * config/vxcache.c: New file. Provide __clear_cache, based on diff --git a/libgcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c index a397799..241e355 100644 --- a/libgcc/config/i386/crtprec.c +++ b/libgcc/config/i386/crtprec.c @@ -39,7 +39,7 @@ set_precision (void) { unsigned short int cwd; - asm volatile ("fstcw\t%0" : "=m" (cwd)); + asm volatile ("fnstcw\t%0" : "=m" (cwd)); cwd &= ~X87CW_PCMASK; cwd |= X87CW; -- cgit v1.1 From af8096fc2b6ee76426b021a2657291dfc62ca933 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 3 Oct 2018 22:29:10 +0200 Subject: libgcc2.c (isnan): Use __builtin_isnan. * libgcc2.c (isnan): Use __builtin_isnan. (isfinite): Use __builtin_isfinite. (isinf): Use __builtin_isinf. From-SVN: r264823 --- libgcc/ChangeLog | 18 ++++++++++++------ libgcc/libgcc2.c | 12 +++--------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e08168c..d4abb3b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-03 Uros Bizjak + + * libgcc2.c (isnan): Use __builtin_isnan. + (isfinite): Use __builtin_isfinite. + (isinf): Use __builtin_isinf. + 2018-09-26 Uros Bizjak * config/i386/crtprec.c (set_precision): Use fnstcw instead of fstcw. @@ -105,7 +111,7 @@ unordered store to release lock. (__sync_lock_release_8): Likewise. (SYNC_LOCK_RELEASE_2): Remove define. - + 2018-08-02 Nicolas Pitre PR libgcc/86512 @@ -416,7 +422,7 @@ * config/pa/fptr.c (_dl_read_access_allowed): New. (__canonicalize_funcptr_for_compare): Use it. - + 2018-02-28 Jakub Jelinek PR debug/83917 @@ -513,21 +519,21 @@ * config/rl78/t-rl78: Added smindi3.S to LIB2ADD. 2018-01-22 Sebastian Perta - + * config/rl78/smaxdi3.S: New assembly file. * config/rl78/t-rl78: Added smaxdi3.S to LIB2ADD. 2018-01-22 Sebastian Perta - + * config/rl78/umaxdi3.S: New assembly file. * config/rl78/t-rl78: Added umaxdi3.S to LIB2ADD. - + 2018-01-21 John David Anglin PR lto/83452 * config/pa/stublib.c (L_gnu_lto_v1): New stub definition. * config/pa/t-stublib (gnu_lto_v1-stub.o): Add make fragment. - + 2018-01-13 Richard Sandiford * config/aarch64/value-unwind.h (aarch64_vg): New function. diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index f418f3a..8ac2025 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1939,15 +1939,9 @@ NAME (TYPE x, int m) #define CONCAT2(A,B) _CONCAT2(A,B) #define _CONCAT2(A,B) A##B -/* All of these would be present in a full C99 implementation of - and . Our problem is that only a few systems have such full - implementations. Further, libgcc_s.so isn't currently linked against - libm.so, and even for systems that do provide full C99, the extra overhead - of all programs using libgcc having to link against libm. So avoid it. */ - -#define isnan(x) __builtin_expect ((x) != (x), 0) -#define isfinite(x) __builtin_expect (!isnan((x) - (x)), 1) -#define isinf(x) __builtin_expect (!isnan(x) & !isfinite(x), 0) +#define isnan(x) __builtin_isnan (x) +#define isfinite(x) __builtin_isfinite (x) +#define isinf(x) __builtin_isinf (x) #define INFINITY CONCAT2(__builtin_huge_val, CEXT) () #define I 1i -- cgit v1.1 From 3edbcdbead288664d874dd3a2e0d8ada4c565af0 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 4 Oct 2018 14:41:14 +0200 Subject: Fix divergence in indirect profiling (PR gcov-profile/84107). 2018-10-04 Martin Liska PR gcov-profile/84107 * tree-profile.c (init_ic_make_global_vars): Remove ic_void_ptr_var and ic_gcov_type_ptr_var. Come up with new ic_tuple* variables. Emit __gcov_indirect_call{,_topn} variables. (gimple_gen_ic_profiler): Access the variable and emit gimple. (gimple_gen_ic_func_profiler): Access __gcov_indirect_call.callee field. (gimple_init_gcov_profiler): Use ptr_type_node. * value-prof.c (gimple_ic): Use ptr_type_node. 2018-10-04 Martin Liska PR gcov-profile/84107 * libgcov-profiler.c (__gcov_indirect_call): Change type to indirect_call_tuple. (struct indirect_call_tuple): New struct. (__gcov_indirect_call_topn_profiler): Change type. (__gcov_indirect_call_profiler_v2): Use the new variables. * libgcov.h (struct indirect_call_tuple): New struct definition. From-SVN: r264840 --- libgcc/ChangeLog | 12 ++++++++++++ libgcc/libgcov-profiler.c | 25 ++++++++----------------- libgcc/libgcov.h | 9 +++++++++ 3 files changed, 29 insertions(+), 17 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d4abb3b..7987129 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,15 @@ +2018-10-04 Martin Liska + + PR gcov-profile/84107 + * libgcov-profiler.c (__gcov_indirect_call): + Change type to indirect_call_tuple. + (struct indirect_call_tuple): New struct. + (__gcov_indirect_call_topn_profiler): Change type. + (__gcov_indirect_call_profiler_v2): Use the new + variables. + * libgcov.h (struct indirect_call_tuple): New struct + definition. + 2018-10-03 Uros Bizjak * libgcc2.c (isnan): Use __builtin_isnan. diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 7e208d7..7a5e500 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -271,12 +271,7 @@ __gcov_topn_value_profiler_body (gcov_type *counters, gcov_type value) #if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif -gcov_type *__gcov_indirect_call_topn_counters ATTRIBUTE_HIDDEN; - -#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) -__thread -#endif -void *__gcov_indirect_call_topn_callee ATTRIBUTE_HIDDEN; +struct indirect_call_tuple __gcov_indirect_call_topn; #ifdef TARGET_VTABLE_USES_DESCRIPTORS #define VTABLE_USES_DESCRIPTORS 1 @@ -290,14 +285,14 @@ void *__gcov_indirect_call_topn_callee ATTRIBUTE_HIDDEN; void __gcov_indirect_call_topn_profiler (gcov_type value, void* cur_func) { - void *callee_func = __gcov_indirect_call_topn_callee; + void *callee_func = __gcov_indirect_call_topn.callee; /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ if (cur_func == callee_func || (VTABLE_USES_DESCRIPTORS && callee_func && *(void **) cur_func == *(void **) callee_func)) - __gcov_topn_value_profiler_body (__gcov_indirect_call_topn_counters, value); + __gcov_topn_value_profiler_body (__gcov_indirect_call_topn.counters, value); } #endif @@ -311,11 +306,7 @@ __gcov_indirect_call_topn_profiler (gcov_type value, void* cur_func) #if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif -void * __gcov_indirect_call_callee; -#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) -__thread -#endif -gcov_type * __gcov_indirect_call_counters; +struct indirect_call_tuple __gcov_indirect_call; /* By default, the C++ compiler will use function addresses in the vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero @@ -332,12 +323,12 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ - if (cur_func == __gcov_indirect_call_callee + if (cur_func == __gcov_indirect_call.callee || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ - && *(void **) cur_func == *(void **) __gcov_indirect_call_callee)) - __gcov_one_value_profiler_body (__gcov_indirect_call_counters, value, 0); + && *(void **) cur_func == *(void **) __gcov_indirect_call.callee)) + __gcov_one_value_profiler_body (__gcov_indirect_call.counters, value, 0); - __gcov_indirect_call_callee = NULL; + __gcov_indirect_call.callee = NULL; } #endif diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 2142287..ee05a68 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -226,6 +226,15 @@ struct gcov_master gcov_unsigned_t version; struct gcov_root *root; }; + +struct indirect_call_tuple +{ + /* Callee function. */ + void *callee; + + /* Pointer to counters. */ + gcov_type *counters; +}; /* Exactly one of these will be active in the process. */ extern struct gcov_master __gcov_master; -- cgit v1.1