diff options
author | Martin Liska <mliska@suse.cz> | 2020-05-05 16:15:47 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-05-05 16:15:47 +0200 |
commit | 811b7636cb8c10f1a550a76242b5666c7ae36da2 (patch) | |
tree | ea0379a64bf214b68baee4d56fd693cfd01fb914 | |
parent | c0532db47d092430f8e8f497b2dc53343527bb13 (diff) | |
download | gcc-811b7636cb8c10f1a550a76242b5666c7ae36da2.zip gcc-811b7636cb8c10f1a550a76242b5666c7ae36da2.tar.gz gcc-811b7636cb8c10f1a550a76242b5666c7ae36da2.tar.bz2 |
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.
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 4 | ||||
-rw-r--r-- | libgcc/ChangeLog | 12 | ||||
-rw-r--r-- | libgcc/Makefile.in | 2 | ||||
-rw-r--r-- | libgcc/gcov.h | 5 | ||||
-rw-r--r-- | libgcc/libgcov-interface.c | 36 |
6 files changed, 28 insertions, 37 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f18676..6186c07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2020-05-05 Martin Liska <mliska@suse.cz> + PR gcov-profile/93623 + * tree-cfg.c (stmt_can_terminate_bb_p): Update comment to reflect + reality. + +2020-05-05 Martin Liska <mliska@suse.cz> + * opt-functions.awk (opt_args_non_empty): New function. * opt-read.awk: Use the function for various option arguments. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index e99fb9f..b21ef0e 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -8439,8 +8439,8 @@ stmt_can_terminate_bb_p (gimple *t) && (call_flags & ECF_NOTHROW) && !(call_flags & ECF_RETURNS_TWICE) /* fork() doesn't really return twice, but the effect of - wrapping it in __gcov_fork() which calls __gcov_flush() - and clears the counters before forking has the same + wrapping it in __gcov_fork() which calls __gcov_dump() and + __gcov_reset() and clears the counters before forking has the same effect as returning twice. Force a fake edge. */ && !fndecl_built_in_p (fndecl, BUILT_IN_FORK)) return false; 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 <mliska@suse.cz> 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 <mliska@suse.cz> + + 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 (); } |