]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r254257
authorMartin Liska <mliska@suse.cz>
Thu, 8 Mar 2018 08:55:59 +0000 (09:55 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 8 Mar 2018 08:55:59 +0000 (08:55 +0000)
2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2017-10-31  Martin Liska  <mliska@suse.cz>

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.

From-SVN: r258357

gcc/ChangeLog
gcc/configure
gcc/configure.ac
gcc/doc/gcov.texi

index a0b9fd33c3de343489162a6498779990f1ef3bf8..55ee561efdcb1d756ea7819d511f0a7e24219491 100644 (file)
@@ -1,3 +1,15 @@
+2018-03-08  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2017-10-31  Martin Liska  <mliska@suse.cz>
+
+       PR gcov-profile/82633
+       * doc/gcov.texi: Document -fkeep-{static,inline}-functions and
+       their interaction with GCOV infrastructure.
+       * configure.ac: Add -fkeep-static-functions to
+       coverage_flags.
+       * configure: Regenerate.
+
 2018-03-08  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index ff3c6e63c0306d0d4315d16d512ba48fd286aef9..b4caeeb813a8991e425a981638cfc7db222a2e17 100755 (executable)
@@ -7352,10 +7352,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-static-functions"
     ;;
   opt)
-    coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2"
+    coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2 -fkeep-static-functions"
     ;;
   no)
     # a.k.a. --disable-coverage
index 0aaa32201a9298019b1915bece63a56fd978616d..4bda5318c99ac06f70e1efdb3118f99e3c1c0522 100644 (file)
@@ -717,10 +717,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-static-functions"
     ;;
   opt)
-    coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2"
+    coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2 -fkeep-static-functions"
     ;;
   no)
     # a.k.a. --disable-coverage
index ff1eca714b1adb2f60f0958dccbf7c9516690ad6..f7b84dd15e7ebd1005bc9295d1d0c93c498e56ef 100644 (file)
@@ -327,6 +327,13 @@ 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 completely remove the bodies of functions that are
+not needed -- for instance if they are inlined everywhere.  Such functions
+are marked with @samp{-}, which can be confusing.
+Use the @option{-fkeep-inline-functions} and @option{-fkeep-static-functions}
+options to retain these functions and
+allow gcov to properly show their @var{execution_count}.
+
 Some lines of information at the start have @var{line_number} of zero.
 These preamble lines are of the form