From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32927 invoked by alias); 26 Oct 2017 08:12:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 32786 invoked by uid 89); 26 Oct 2017 08:12:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=exceptional, interaction X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 08:12:39 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2FFE0ABFA for ; Thu, 26 Oct 2017 08:12:37 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Thu, 26 Oct 2017 10:12:36 +0200 Resent-Message-ID: <9bd75cbf-27e2-cf13-3157-142b8bf71037@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 Message-Id: <22f49725f56049abf9bf99edd7e79728b180fad1.1509005504.git.mliska@suse.cz> In-Reply-To: References: From: marxin Date: Thu, 26 Oct 2017 08:12:00 -0000 Subject: [PATCH 1/7] GCOV: document behavior of -fkeep-{static,inline}-functions (PR gcov-profile/82633). To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg01893.txt.bz2 gcc/ChangeLog: 2017-10-23 Martin Liska PR gcov-profile/82633 * doc/gcov.texi: Document -fkeep-{static,inline}-functions and their interaction with GCOV infrastructure. * configure.ac: Add -fkeep-{inline,static}-functions to coverage_flags. * configure: Regenerate. --- gcc/configure | 4 ++-- gcc/configure.ac | 4 ++-- gcc/doc/gcov.texi | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/configure b/gcc/configure index aa5937df84c..7f9d740e93c 100755 --- a/gcc/configure +++ b/gcc/configure @@ -7321,10 +7321,10 @@ fi if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; case "${enableval}" in yes|noopt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0 -fkeep-inline-functions -fkeep-static-functions" ;; opt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2 -fkeep-inline-functions -fkeep-static-functions" ;; no) # a.k.a. --disable-coverage diff --git a/gcc/configure.ac b/gcc/configure.ac index d905d0d980a..46b4a80b9a1 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -728,10 +728,10 @@ AC_ARG_ENABLE(coverage, default is noopt])], [case "${enableval}" in yes|noopt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0 -fkeep-inline-functions -fkeep-static-functions" ;; opt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2 -fkeep-inline-functions -fkeep-static-functions" ;; no) # a.k.a. --disable-coverage diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 706aa6cf0b0..c527b89f13b 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -327,6 +327,11 @@ non-exceptional paths or only exceptional paths such as C++ exception handlers, respectively. Given @samp{-a} option, unexecuted blocks are marked @samp{$$$$$} or @samp{%%%%%}, depending on whether a basic block is reachable via non-exceptional or exceptional paths. +Note that GCC can perform function removal for functions obviously not +used in a compilation unit. Such functions are marked with @samp{-} +even though they contain a code. Use @option{-fkeep-inline-functions} and +@option{-fkeep-static-functions} in order to properly +record @var{execution_count} of such functions. Some lines of information at the start have @var{line_number} of zero. These preamble lines are of the form -- 2.14.2