From 7d29f8e3dc105bcc948377a3c68250f555119d8c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 3 Nov 2016 16:24:22 +0100 Subject: Make direct emission of time profiler counter * libgcov-profiler.c (__gcov_time_profiler): Remove. (__gcov_time_profiler_atomic): Likewise. * profile.c (instrument_values): Fix coding style. (branch_prob): Use renamed function. * tree-profile.c (init_ic_make_global_vars): Likewise. (gimple_init_edge_profiler): Rename to gimple_init_gcov_profiler. tree_time_profiler_counter variable declaration. (gimple_gen_time_profiler): Rewrite to do a direct gimple code emission. * value-prof.h: Remove an argument. * gcc.dg/no_profile_instrument_function-attr-1.c: Update scanned output. * gcc.dg/tree-prof/time-profiler-3.c: New test. From-SVN: r241821 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-profiler.c | 23 +---------------------- 2 files changed, 6 insertions(+), 22 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e81444c..e3a81f6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-03 Martin Liska + + * libgcov-profiler.c (__gcov_time_profiler): Remove. + (__gcov_time_profiler_atomic): Likewise. + 2016-11-03 Bernd Edlinger PR libgcc/78067 diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 38ed5f1..4f0a406 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -342,30 +342,9 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) #ifdef L_gcov_time_profiler /* Counter for first visit of each function. */ -static gcov_type function_counter; +gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN; -/* Sets corresponding COUNTERS if there is no value. */ - -void -__gcov_time_profiler (gcov_type* counters) -{ - if (!counters[0]) - counters[0] = ++function_counter; -} - -#if GCOV_SUPPORTS_ATOMIC -/* Sets corresponding COUNTERS if there is no value. - Function is thread-safe. */ - -void -__gcov_time_profiler_atomic (gcov_type* counters) -{ - if (!counters[0]) - counters[0] = __atomic_add_fetch (&function_counter, 1, __ATOMIC_RELAXED); -} #endif -#endif - #ifdef L_gcov_average_profiler /* Increase corresponding COUNTER by VALUE. FIXME: Perhaps we want -- cgit v1.1