From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 2C2BB385DC01 for ; Fri, 3 Apr 2020 08:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2C2BB385DC01 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B7F6CAE81 for ; Fri, 3 Apr 2020 08:11:38 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Fri, 3 Apr 2020 10:11:38 +0200 Resent-Message-ID: Message-Id: <7dfa677a9c2f93b4f22a510e19bb67765b354454.1585901206.git.mliska@suse.cz> In-Reply-To: References: From: Martin Liska Date: Thu, 2 Apr 2020 17:02:26 +0200 Subject: [PATCH 3/3] Remove __gcov_flush. To: gcc-patches@gcc.gnu.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.26.0" X-Spam-Status: No, score=-30.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 08:11:41 -0000 This is a multi-part message in MIME format. --------------2.26.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit gcc/ChangeLog: 2020-04-03 Martin Liska PR gcov-profile/93623 * tree-cfg.c (stmt_can_terminate_bb_p): Update comment to reflect reality. libgcc/ChangeLog: 2020-04-03 Martin Liska 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. --- gcc/tree-cfg.c | 4 ++-- libgcc/Makefile.in | 2 +- libgcc/gcov.h | 5 ----- libgcc/libgcov-interface.c | 36 +++++++----------------------------- 4 files changed, 10 insertions(+), 37 deletions(-) --------------2.26.0 Content-Type: text/x-patch; name="0003-Remove-__gcov_flush.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0003-Remove-__gcov_flush.patch" diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index e99fb9ff5d1..b21ef0eee37 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/Makefile.in b/libgcc/Makefile.in index e6ed153abbc..5c50f9fe4df 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 f1581914dde..0e3eed31032 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 855e8612018..3a8a5bf44b8 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 (); } --------------2.26.0--