diff options
author | Martin Liska <mliska@suse.cz> | 2020-01-27 16:20:10 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-01-27 16:20:10 +0100 |
commit | 3ae37f9297fc97aefc6c6968315bd1ac6a1bc7ef (patch) | |
tree | ac9381bb63fe63370b33c674a651116a9f52fd46 /libgcc/libgcov-profiler.c | |
parent | 6a81cabc14426b642271647b03218a3af19d600f (diff) | |
download | gcc-3ae37f9297fc97aefc6c6968315bd1ac6a1bc7ef.zip gcc-3ae37f9297fc97aefc6c6968315bd1ac6a1bc7ef.tar.gz gcc-3ae37f9297fc97aefc6c6968315bd1ac6a1bc7ef.tar.bz2 |
Add __gcov_indirect_call_profiler_v4_atomic.
PR gcov-profile/93403
* tree-profile.c (gimple_init_gcov_profiler): Generate
both __gcov_indirect_call_profiler_v4 and
__gcov_indirect_call_profiler_v4_atomic.
PR gcov-profile/93403
* libgcov-profiler.c (__gcov_indirect_call_profiler_v4):
Call __gcov_indirect_call_profiler_body.
(__gcov_indirect_call_profiler_body): New.
(__gcov_indirect_call_profiler_v4_atomic): New.
* libgcov.h (__gcov_indirect_call_profiler_v4_atomic):
New declaration.
Diffstat (limited to 'libgcc/libgcov-profiler.c')
-rw-r--r-- | libgcc/libgcov-profiler.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 58784d1..6043ac4 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -199,8 +199,9 @@ struct indirect_call_tuple __gcov_indirect_call; as a pointer to a function. */ /* Tries to determine the most common value among its inputs. */ -void -__gcov_indirect_call_profiler_v4 (gcov_type value, void* cur_func) +static inline void +__gcov_indirect_call_profiler_body (gcov_type value, void *cur_func, + int use_atomic) { /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference @@ -208,10 +209,26 @@ __gcov_indirect_call_profiler_v4 (gcov_type value, void* cur_func) if (cur_func == __gcov_indirect_call.callee || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && *(void **) cur_func == *(void **) __gcov_indirect_call.callee)) - __gcov_topn_values_profiler_body (__gcov_indirect_call.counters, value, 0); + __gcov_topn_values_profiler_body (__gcov_indirect_call.counters, value, + use_atomic); __gcov_indirect_call.callee = NULL; } + +void +__gcov_indirect_call_profiler_v4 (gcov_type value, void *cur_func) +{ + __gcov_indirect_call_profiler_body (value, cur_func, 0); +} + +#if GCOV_SUPPORTS_ATOMIC +void +__gcov_indirect_call_profiler_v4_atomic (gcov_type value, void *cur_func) +{ + __gcov_indirect_call_profiler_body (value, cur_func, 1); +} +#endif + #endif #ifdef L_gcov_time_profiler |