Add -fprofile-note option.
authorMartin Liska <mliska@suse.cz>
Wed, 3 Jul 2019 08:29:08 +0000 (10:29 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 3 Jul 2019 08:29:08 +0000 (08:29 +0000)
2019-07-03  Martin Liska  <mliska@suse.cz>

* common.opt: Add fprofile-note.
* coverage.c (coverage_init): Append the option
to bbg_file_name.
* doc/invoke.texi: Document -fprofile-note.

From-SVN: r272990

gcc/ChangeLog
gcc/common.opt
gcc/coverage.c
gcc/doc/invoke.texi

index 743b85d85bdfb3668b359bf10614624adcda8402..ca9ca7bfd06c936ff65e9a28607c192021fd7f4c 100644 (file)
@@ -1,3 +1,10 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * common.opt: Add fprofile-note.
+       * coverage.c (coverage_init): Append the option
+       to bbg_file_name.
+       * doc/invoke.texi: Document -fprofile-note.
+
 2019-07-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/91033
index a1544d06824eebf41a76e014c98b949933f18752..c1b90562b9b1eddd089d6f8cb6aac9c6165e59dc 100644 (file)
@@ -2096,6 +2096,10 @@ Common Joined RejectNegative Var(profile_data_prefix)
 Set the top-level directory for storing the profile data.
 The default is 'pwd'.
 
+fprofile-note=
+Common Joined RejectNegative Var(profile_note_location)
+Select the name for storing the profile note file.
+
 fprofile-correction
 Common Report Var(flag_profile_correction)
 Enable correction of flow inconsistent profile data input.
index 1ffefd5f482053308c3dc6f87aec69f0109ec7a0..960ff7ee86ab7a99cfd2ae1d2811f597ac658987 100644 (file)
@@ -1255,9 +1255,14 @@ coverage_init (const char *filename)
   /* Name of bbg file.  */
   if (flag_test_coverage && !flag_compare_debug)
     {
-      bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1);
-      memcpy (bbg_file_name, filename, len);
-      strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX);
+      if (profile_note_location)
+       bbg_file_name = xstrdup (profile_note_location);
+      else
+       {
+         bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1);
+         memcpy (bbg_file_name, filename, len);
+         strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX);
+       }
 
       if (!gcov_open (bbg_file_name, -1))
        {
index ae1a7d252779f70c6308c75aa12141ef1a3d8242..73d16b59d91695a17f2f93588074ddb151d2c284 100644 (file)
@@ -493,8 +493,8 @@ Objective-C and Objective-C++ Dialects}.
 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
 -fprofile-abs-path @gol
 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
--fprofile-update=@var{method}  -fprofile-filter-files=@var{regex} @gol
--fprofile-exclude-files=@var{regex} @gol
+-fprofile-note=@var{path}  -fprofile-update=@var{method} @gol
+-fprofile-filter-files=@var{regex}  -fprofile-exclude-files=@var{regex} @gol
 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
@@ -12404,6 +12404,11 @@ the profile feedback data files. See @option{-fprofile-dir}.
 To optimize the program based on the collected profile information, use
 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
 
+@item -fprofile-note=@var{path}
+@opindex fprofile-note
+
+If @var{path} is specified, GCC saves gcno filename into @var{path} location.
+
 @item -fprofile-update=@var{method}
 @opindex fprofile-update