This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Backports to GCC 5.x


Hello.

I'm going to install the very same set of patches as for GCC 6.x except first 4 patches
to ipa-visibility.c. These will be more complicated to backport.

Martin
>From 4d28482901c9569abd91cbff64a2362d39be50a1 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 31 May 2017 11:40:13 +0000
Subject: [PATCH 11/11] Backport r248729

gcc/ChangeLog:

2017-05-31  Martin Liska  <mliska@suse.cz>

	PR target/79155
	* config/i386/cpuid.h: Fix typo in a comment in cpuid.h.
---
 gcc/config/i386/cpuid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index c7778d989f5..1b6ab6d0a56 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -167,7 +167,7 @@
 
 
 /* Return highest supported input value for cpuid instruction.  ext can
-   be either 0x0 or 0x8000000 to return highest supported value for
+   be either 0x0 or 0x80000000 to return highest supported value for
    basic or extended cpuid information.  Function returns 0 if cpuid
    is not supported or whatever cpuid returns in eax register.  If sig
    pointer is non-null, then first four bytes of the signature
-- 
2.13.1

>From 0adb19b368f9ab41a3d841943afc3c211dda2c91 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 30 May 2017 08:02:03 +0000
Subject: [PATCH 10/11] Backport r248647

gcc/ChangeLog:

2017-05-30  Martin Liska  <mliska@suse.cz>

	PR other/80909
	* auto-profile.c (get_function_decl_from_block): Fix
	parenthesis.
---
 gcc/auto-profile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 5e212dd0579..b8b02d174b4 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -390,7 +390,7 @@ get_function_decl_from_block (tree block)
 {
   tree decl;
 
-  if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block) == UNKNOWN_LOCATION))
+  if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) == UNKNOWN_LOCATION)
     return NULL_TREE;
 
   for (decl = BLOCK_ABSTRACT_ORIGIN (block);
-- 
2.13.1

>From 94700d27b89ad1840f734ee5b317d317cf69000b Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 26 May 2017 11:05:52 +0000
Subject: [PATCH 09/11] Backport r248489

gcc/ChangeLog:

2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* params.def: Bound partial-inlining-entry-probability param.

gcc/testsuite/ChangeLog:

2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* g++.dg/ipa/pr80212.C: Remove the test as it does not longer
	split at the problematic spot.
	* gcc.dg/ipa/pr48195.c: Change 101 to 100 as 101 is no longer
	a valid value of the param.
---
 gcc/params.def                     |  2 +-
 gcc/testsuite/g++.dg/ipa/pr80212.C | 18 ------------------
 gcc/testsuite/gcc.dg/ipa/pr48195.c |  2 +-
 3 files changed, 2 insertions(+), 20 deletions(-)
 delete mode 100644 gcc/testsuite/g++.dg/ipa/pr80212.C

diff --git a/gcc/params.def b/gcc/params.def
index 33d637675ab..1995f1435f6 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -121,7 +121,7 @@ DEFPARAM (PARAM_COMDAT_SHARING_PROBABILITY,
 DEFPARAM (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY,
 	  "partial-inlining-entry-probability",
 	  "Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen",
-	  70, 0, 0)
+	  70, 0, 100)
 
 /* Limit the number of expansions created by the variable expansion
    optimization to avoid register pressure.  */
diff --git a/gcc/testsuite/g++.dg/ipa/pr80212.C b/gcc/testsuite/g++.dg/ipa/pr80212.C
deleted file mode 100644
index 60d3b613035..00000000000
--- a/gcc/testsuite/g++.dg/ipa/pr80212.C
+++ /dev/null
@@ -1,18 +0,0 @@
-// PR ipa/80212
-// { dg-options "-O2 --param partial-inlining-entry-probability=403796683 -fno-early-inlining" }
-
-struct b
-{
-  virtual b *c () const;
-};
-struct d : virtual b
-{
-};
-struct e : d
-{
-  e *
-  c () const
-  {
-  }
-};
-main () { e a; }
diff --git a/gcc/testsuite/gcc.dg/ipa/pr48195.c b/gcc/testsuite/gcc.dg/ipa/pr48195.c
index 2e38452d598..25e80bab8f8 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr48195.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr48195.c
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=101" } */
+/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=100" } */
 /* { dg-require-effective-target lto } */
 
 extern void abort(void);
-- 
2.13.1

>From 16c78edc5442a73dd48d5b325d987320d16ccaae Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 16 May 2017 08:57:05 +0000
Subject: [PATCH 08/11] Backport r248089

gcc/ChangeLog:

2017-05-16  Martin Liska  <mliska@suse.cz>

	PR ipa/79850.
	* ipa-devirt.c (odr_types_equivalent_p): Fix typo.
---
 gcc/ipa-devirt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 08cfa8033f0..316f33624bc 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1459,7 +1459,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
 		    if (DECL_ARTIFICIAL (f1))
 		      break;
 		    warn_odr (t1, t2, f1, f2, warn, warned,
-			      G_("fields has different layout "
+			      G_("fields have different layout "
 				 "in another translation unit"));
 		    return false;
 		  }
-- 
2.13.1

>From 01a907f31dc7a74e22b42bdb56983c804c778def Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 15 May 2017 12:48:35 +0000
Subject: [PATCH 07/11] Backport r248060

gcc/ChangeLog:

2017-05-15  Martin Liska  <mliska@suse.cz>

	PR driver/31468
	* gcc.c (process_command): Do not allow empty argument of -o option.
---
 gcc/gcc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index f21987f4d40..30051020e7f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4203,6 +4203,9 @@ process_command (unsigned int decoded_options_count,
 		       output_file);
     }
 
+  if (output_file != NULL && output_file[0] == '\0')
+    fatal_error (input_location, "output filename may not be empty");
+
   /* If -save-temps=obj and -o name, create the prefix to use for %b.
      Otherwise just make -save-temps=obj the same as -save-temps=cwd.  */
   if (save_temps_flag == SAVE_TEMPS_OBJ && save_temps_prefix != NULL)
-- 
2.13.1

>From 2b088c2be5797f1324620215f1b48b330a6a0716 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 2 May 2017 15:37:41 +0000
Subject: [PATCH 06/11] Backport r247507

gcc/ChangeLog:

2017-05-02  Martin Liska  <mliska@suse.cz>

	* doc/gcov.texi: Add missing preposition.
	* gcov.c (function_info::function_info): Properly fill up
	all member variables.
---
 gcc/doc/gcov.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 9f9c52ac137..12586b7e8d0 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -324,7 +324,7 @@ containing no code.  Unexecuted lines are marked @samp{#####} or
 @samp{====}, depending on whether they are reachable by
 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 whether a basic block
+marked @samp{$$$$$} or @samp{%%%%%}, depending on whether a basic block
 is reachable via non-exceptional or exceptional paths.
 
 Some lines of information at the start have @var{line_number} of zero.
-- 
2.13.1

>From 06e79dcd3c49028c692a5db9ca2e2aa4bef6792f Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 2 May 2017 09:38:55 +0000
Subject: [PATCH 05/11] Backport r247485

gcc/ChangeLog:

2017-05-02  Martin Liska  <mliska@suse.cz>

	PR other/80589
	* common.opt: Fix typo.
	* doc/invoke.texi: Likewise.
---
 gcc/common.opt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 429811e585c..ac6546c24a3 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2273,7 +2273,7 @@ flow and turn the statement with erroneous or undefined behavior into a trap.
 
 fisolate-erroneous-paths-attribute
 Common Report Var(flag_isolate_erroneous_paths_attribute) Optimization
-Detect paths that trigger erroneous or undefined behavior due a null value
+Detect paths that trigger erroneous or undefined behavior due to a null value
 being used in a way forbidden by a returns_nonnull or nonnull
 attribute.  Isolate those paths from the main control flow and turn the
 statement with erroneous or undefined behavior into a trap. 
-- 
2.13.1

>From a29187dab1f64928cdbabafae60fc78200661d44 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 28 Apr 2017 12:51:57 +0000
Subject: [PATCH 04/11] Backport r247377

gcc/ChangeLog:

2017-04-28  Martin Liska  <mliska@suse.cz>

	* doc/gcov.texi: Enhance documentation of gcov.
---
 gcc/doc/gcov.texi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 3ba3621c594..9f9c52ac137 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -323,7 +323,9 @@ command line option.  The @var{execution_count} is @samp{-} for lines
 containing no code.  Unexecuted lines are marked @samp{#####} or
 @samp{====}, depending on whether they are reachable by
 non-exceptional paths or only exceptional paths such as C++ exception
-handlers, respectively.
+handlers, respectively. Given @samp{-a} option, unexecuted blocks are
+marked @samp{$$$$$} or @samp{%%%%%}, depending whether a basic block
+is reachable via non-exceptional or exceptional paths.
 
 Some lines of information at the start have @var{line_number} of zero.
 These preamble lines are of the form
@@ -668,5 +670,5 @@ it.  This can be overcome by, for example, setting the environment as
 setting will name the data file @file{/target/run/build/foo.gcda}.
 
 You must move the data files to the expected directory tree in order to
-use them for profile directed optimizations (@option{--use-profile}), or to
+use them for profile directed optimizations (@option{-fprofile-use}), or to
 use the @command{gcov} tool.
-- 
2.13.1

>From 9024b65a4ce34bade8f80959f0a277fa620db1eb Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 28 Apr 2017 12:51:40 +0000
Subject: [PATCH 03/11] Backport r247376

gcc/ChangeLog:

2017-04-28  Martin Liska  <mliska@suse.cz>

	* doc/gcov.texi: Sort options in alphabetic order.
	* doc/gcov-dump.texi: Likewise.
	* doc/gcov-tool.texi: Likewise.
	* gcov.c (print_usage): Likewise.
	* gcov-dump.c (print_usage): Likewise.
	* gcov-tool.c (print_merge_usage_message): Likewise.
	(print_rewrite_usage_message): Likewise.
	(print_overlap_usage_message): Likewise.
---
 gcc/doc/gcov-dump.texi |  10 ++--
 gcc/doc/gcov-tool.texi |  50 ++++++++---------
 gcc/doc/gcov.texi      | 147 +++++++++++++++++++++++++++----------------------
 gcc/gcov-dump.c        |   2 +-
 gcc/gcov-tool.c        |   9 +--
 gcc/gcov.c             |   2 +-
 6 files changed, 118 insertions(+), 102 deletions(-)

diff --git a/gcc/doc/gcov-dump.texi b/gcc/doc/gcov-dump.texi
index d7931fd3a19..26653d28def 100644
--- a/gcc/doc/gcov-dump.texi
+++ b/gcc/doc/gcov-dump.texi
@@ -72,11 +72,6 @@ gcov-dump [@option{-v}|@option{--version}]
 Display help about using @command{gcov-dump} (on the standard output), and
 exit without doing any further processing.
 
-@item -v
-@itemx --version
-Display the @command{gcov-dump} version number (on the standard output),
-and exit without doing any further processing.
-
 @item -l
 @itemx --long
 Dump content of records.
@@ -85,6 +80,11 @@ Dump content of records.
 @itemx --positions
 Dump positions of records.
 
+@item -v
+@itemx --version
+Display the @command{gcov-dump} version number (on the standard output),
+and exit without doing any further processing.
+
 @item -w
 @itemx --working-sets
 Dump working set computed from summary.
diff --git a/gcc/doc/gcov-tool.texi b/gcc/doc/gcov-tool.texi
index 6f3f6b4a76d..65a647bd818 100644
--- a/gcc/doc/gcov-tool.texi
+++ b/gcc/doc/gcov-tool.texi
@@ -113,23 +113,23 @@ gcov-tool @r{[}@var{global-options}@r{]} SUB_COMMAND @r{[}@var{sub_command-optio
 gcov-tool [@option{-v}|@option{--version}] [@option{-h}|@option{--help}]
 
 gcov-tool merge [merge-options] @var{directory1} @var{directory2}
+     [@option{-o}|@option{--output} @var{directory}]
      [@option{-v}|@option{--verbose}]
-     [@option{-o}|@option{ --output} @var{directory}]
      [@option{-w}|@option{--weight} @var{w1,w2}]
 
 gcov-tool rewrite [rewrite-options] @var{directory}
-     [@option{-v}|@option{--verbose}]
+     [@option{-n}|@option{--normalize} @var{long_long_value}]
      [@option{-o}|@option{--output} @var{directory}]
      [@option{-s}|@option{--scale} @var{float_or_simple-frac_value}]
-     [@option{-n}|@option{--normalize} @var{long_long_value}]
+     [@option{-v}|@option{--verbose}]
 
 gcov-tool overlap [overlap-options] @var{directory1} @var{directory2}
-     [@option{-v}|@option{--verbose}]
-     [@option{-h}|@option{--hotonly}]
      [@option{-f}|@option{--function}]
      [@option{-F}|@option{--fullname}]
+     [@option{-h}|@option{--hotonly}]
      [@option{-o}|@option{--object}]
      [@option{-t}|@option{--hot_threshold}] @var{float}
+     [@option{-v}|@option{--verbose}]
 
 @c man end
 @c man begin SEEALSO
@@ -152,17 +152,17 @@ and exit without doing any further processing.
 
 @item merge
 Merge two profile directories.
-
 @table @gcctabopt
-@item -v
-@itemx --verbose
-Set the verbose mode.
 
 @item -o @var{directory}
 @itemx --output @var{directory}
 Set the output profile directory. Default output directory name is
 @var{merged_profile}.
 
+@item -v
+@itemx --verbose
+Set the verbose mode.
+
 @item -w @var{w1},@var{w2}
 @itemx --weight @var{w1},@var{w2}
 Set the merge weights of the @var{directory1} and @var{directory2},
@@ -171,11 +171,12 @@ respectively. The default weights are 1 for both.
 
 @item rewrite
 Read the specified profile directory and rewrite to a new directory.
-
 @table @gcctabopt
-@item -v
-@itemx --verbose
-Set the verbose mode.
+
+@item -n @var{long_long_value}
+@itemx --normalize <long_long_value>
+Normalize the profile. The specified value is the max counter value
+in the new profile.
 
 @item -o @var{directory}
 @itemx --output @var{directory}
@@ -186,10 +187,9 @@ Set the output profile directory. Default output name is @var{rewrite_profile}.
 Scale the profile counters. The specified value can be in floating point value,
 or simple fraction value form, such 1, 2, 2/3, and 5/3.
 
-@item -n @var{long_long_value}
-@itemx --normalize <long_long_value>
-Normalize the profile. The specified value is the max counter value
-in the new profile.
+@item -v
+@itemx --verbose
+Set the verbose mode.
 @end table
 
 @item overlap
@@ -201,14 +201,6 @@ matched counters and p1_sum_all and p2_sum_all are the sum of counter
 values in profile 1 and profile 2, respectively.
 
 @table @gcctabopt
-@item -v
-@itemx --verbose
-Set the verbose mode.
-
-@item -h
-@itemx --hotonly
-Only print info for hot objects/functions.
-
 @item -f
 @itemx --function
 Print function level overlap score.
@@ -217,6 +209,10 @@ Print function level overlap score.
 @itemx --fullname
 Print full gcda filename.
 
+@item -h
+@itemx --hotonly
+Only print info for hot objects/functions.
+
 @item -o
 @itemx --object
 Print object level overlap score.
@@ -224,6 +220,10 @@ Print object level overlap score.
 @item -t @var{float}
 @itemx --hot_threshold <float>
 Set the threshold for hot counter value.
+
+@item -v
+@itemx --verbose
+Set the verbose mode.
 @end table
 
 @end table
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index dba36e0b972..3ba3621c594 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -142,15 +142,6 @@ gpl(7), gfdl(7), fsf-funding(7), gcc(1) and the Info entry for @file{gcc}.
 
 @c man begin OPTIONS
 @table @gcctabopt
-@item -h
-@itemx --help
-Display help about using @command{gcov} (on the standard output), and
-exit without doing any further processing.
-
-@item -v
-@itemx --version
-Display the @command{gcov} version number (on the standard output),
-and exit without doing any further processing.
 
 @item -a
 @itemx --all-blocks
@@ -171,68 +162,18 @@ be shown, unless the @option{-u} option is given.
 Write branch frequencies as the number of branches taken, rather than
 the percentage of branches taken.
 
-@item -n
-@itemx --no-output
-Do not create the @command{gcov} output file.
-
-@item -l
-@itemx --long-file-names
-Create long file names for included source files.  For example, if the
-header file @file{x.h} contains code, and was included in the file
-@file{a.c}, then running @command{gcov} on the file @file{a.c} will
-produce an output file called @file{a.c##x.h.gcov} instead of
-@file{x.h.gcov}.  This can be useful if @file{x.h} is included in
-multiple source files and you want to see the individual
-contributions.  If you use the @samp{-p} option, both the including
-and included file names will be complete path names.
-
-@item -p
-@itemx --preserve-paths
-Preserve complete path information in the names of generated
-@file{.gcov} files.  Without this option, just the filename component is
-used.  With this option, all directories are used, with @samp{/} characters
-translated to @samp{#} characters, @file{.} directory components
-removed and unremoveable @file{..}
-components renamed to @samp{^}.  This is useful if sourcefiles are in several
-different directories.
-
-@item -r
-@itemx --relative-only
-Only output information about source files with a relative pathname
-(after source prefix elision).  Absolute paths are usually system
-header files and coverage of any inline functions therein is normally
-uninteresting.
+@item -d
+@itemx --display-progress
+Display the progress on the standard output.
 
 @item -f
 @itemx --function-summaries
 Output summaries for each function in addition to the file level summary.
 
-@item -o @var{directory|file}
-@itemx --object-directory @var{directory}
-@itemx --object-file @var{file}
-Specify either the directory containing the gcov data files, or the
-object path name.  The @file{.gcno}, and
-@file{.gcda} data files are searched for using this option.  If a directory
-is specified, the data files are in that directory and named after the
-input file name, without its extension.  If a file is specified here,
-the data files are named after that file, without its extension.
-
-@item -s @var{directory}
-@itemx --source-prefix @var{directory}
-A prefix for source file names to remove when generating the output
-coverage files.  This option is useful when building in a separate
-directory, and the pathname to the source directory is not wanted when
-determining the output file names.  Note that this prefix detection is
-applied before determining whether the source file is absolute.
-
-@item -u
-@itemx --unconditional-branches
-When branch probabilities are given, include those of unconditional branches.
-Unconditional branches are normally not interesting.
-
-@item -d
-@itemx --display-progress
-Display the progress on the standard output.
+@item -h
+@itemx --help
+Display help about using @command{gcov} (on the standard output), and
+exit without doing any further processing.
 
 @item -i
 @itemx --intermediate-format
@@ -273,11 +214,85 @@ lcount:26,1
 branch:28,nottaken
 @end smallexample
 
+@item -l
+@itemx --long-file-names
+Create long file names for included source files.  For example, if the
+header file @file{x.h} contains code, and was included in the file
+@file{a.c}, then running @command{gcov} on the file @file{a.c} will
+produce an output file called @file{a.c##x.h.gcov} instead of
+@file{x.h.gcov}.  This can be useful if @file{x.h} is included in
+multiple source files and you want to see the individual
+contributions.  If you use the @samp{-p} option, both the including
+and included file names will be complete path names.
+
 @item -m
 @itemx --demangled-names
 Display demangled function names in output. The default is to show
 mangled function names.
 
+@item -n
+@itemx --no-output
+Do not create the @command{gcov} output file.
+
+@item -o @var{directory|file}
+@itemx --object-directory @var{directory}
+@itemx --object-file @var{file}
+Specify either the directory containing the gcov data files, or the
+object path name.  The @file{.gcno}, and
+@file{.gcda} data files are searched for using this option.  If a directory
+is specified, the data files are in that directory and named after the
+input file name, without its extension.  If a file is specified here,
+the data files are named after that file, without its extension.
+
+@item -p
+@itemx --preserve-paths
+Preserve complete path information in the names of generated
+@file{.gcov} files.  Without this option, just the filename component is
+used.  With this option, all directories are used, with @samp{/} characters
+translated to @samp{#} characters, @file{.} directory components
+removed and unremoveable @file{..}
+components renamed to @samp{^}.  This is useful if sourcefiles are in several
+different directories.
+
+@item -r
+@itemx --relative-only
+Only output information about source files with a relative pathname
+(after source prefix elision).  Absolute paths are usually system
+header files and coverage of any inline functions therein is normally
+uninteresting.
+
+@item -s @var{directory}
+@itemx --source-prefix @var{directory}
+A prefix for source file names to remove when generating the output
+coverage files.  This option is useful when building in a separate
+directory, and the pathname to the source directory is not wanted when
+determining the output file names.  Note that this prefix detection is
+applied before determining whether the source file is absolute.
+
+@item -u
+@itemx --unconditional-branches
+When branch probabilities are given, include those of unconditional branches.
+Unconditional branches are normally not interesting.
+
+@item -v
+@itemx --version
+Display the @command{gcov} version number (on the standard output),
+and exit without doing any further processing.
+
+@item -w
+@itemx --verbose
+Print verbose informations related to basic blocks and arcs.
+
+@item -x
+@itemx --hash-filenames
+By default, gcov uses the full pathname of the source files to to create
+an output filename.  This can lead to long filenames that can overflow
+filesystem limits.  This option creates names of the form
+@file{@var{source-file}##@var{md5}.gcov},
+where the @var{source-file} component is the final filename part and
+the @var{md5} component is calculated from the full mangled name that
+would have been used otherwise.
+
 @end table
 
 @command{gcov} should be run with the current directory the same as that
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index 809ca63e5e4..d6ecd57b8a2 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -132,9 +132,9 @@ print_usage (void)
   printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n");
   printf ("Print coverage file contents\n");
   printf ("  -h, --help           Print this help\n");
-  printf ("  -v, --version        Print version number\n");
   printf ("  -l, --long           Dump record contents too\n");
   printf ("  -p, --positions      Dump record positions\n");
+  printf ("  -v, --version        Print version number\n");
   printf ("  -w, --working-sets   Dump working set computed from summary\n");
   printf ("\nFor bug reporting instructions, please see:\n%s.\n",
 	   bug_report_url);
diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c
index 3a8dfc1ca8b..9865357b8c8 100644
--- a/gcc/gcov-tool.c
+++ b/gcc/gcov-tool.c
@@ -173,8 +173,8 @@ print_merge_usage_message (int error_p)
   FILE *file = error_p ? stderr : stdout;
 
   fnotice (file, "  merge [options] <dir1> <dir2>         Merge coverage file contents\n");
-  fnotice (file, "    -v, --verbose                       Verbose mode\n");
   fnotice (file, "    -o, --output <dir>                  Output directory\n");
+  fnotice (file, "    -v, --verbose                       Verbose mode\n");
   fnotice (file, "    -w, --weight <w1,w2>                Set weights (float point values)\n");
 }
 
@@ -270,10 +270,11 @@ print_rewrite_usage_message (int error_p)
   FILE *file = error_p ? stderr : stdout;
 
   fnotice (file, "  rewrite [options] <dir>               Rewrite coverage file contents\n");
-  fnotice (file, "    -v, --verbose                       Verbose mode\n");
+  fnotice (file, "    -n, --normalize <int64_t>           Normalize the profile\n");
   fnotice (file, "    -o, --output <dir>                  Output directory\n");
   fnotice (file, "    -s, --scale <float or simple-frac>  Scale the profile counters\n");
   fnotice (file, "    -n, --normalize <long long>         Normalize the profile\n");
+  fnotice (file, "    -v, --verbose                       Verbose mode\n");
 }
 
 static const struct option rewrite_options[] =
@@ -426,12 +427,12 @@ print_overlap_usage_message (int error_p)
   FILE *file = error_p ? stderr : stdout;
 
   fnotice (file, "  overlap [options] <dir1> <dir2>       Compute the overlap of two profiles\n");
-  fnotice (file, "    -v, --verbose                       Verbose mode\n");
-  fnotice (file, "    -h, --hotonly                       Only print info for hot objects/functions\n");
   fnotice (file, "    -f, --function                      Print function level info\n");
   fnotice (file, "    -F, --fullname                      Print full filename\n");
+  fnotice (file, "    -h, --hotonly                       Only print info for hot objects/functions\n");
   fnotice (file, "    -o, --object                        Print object level info\n");
   fnotice (file, "    -t <float>, --hot_threshold <float> Set the threshold for hotness\n");
+  fnotice (file, "    -v, --verbose                       Verbose mode\n");
 
 }
 
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 79128ff50c0..869892fbe68 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -471,13 +471,13 @@ print_usage (int error_p)
 
   fnotice (file, "Usage: gcov [OPTION...] SOURCE|OBJ...\n\n");
   fnotice (file, "Print code coverage information.\n\n");
-  fnotice (file, "  -h, --help                      Print this help, then exit\n");
   fnotice (file, "  -a, --all-blocks                Show information for every basic block\n");
   fnotice (file, "  -b, --branch-probabilities      Include branch probabilities in output\n");
   fnotice (file, "  -c, --branch-counts             Output counts of branches taken\n\
                                     rather than percentages\n");
   fnotice (file, "  -d, --display-progress          Display progress information\n");
   fnotice (file, "  -f, --function-summaries        Output summaries for each function\n");
+  fnotice (file, "  -h, --help                      Print this help, then exit\n");
   fnotice (file, "  -i, --intermediate-format       Output .gcov file in intermediate text format\n");
   fnotice (file, "  -l, --long-file-names           Use long output file names for included\n\
                                     source files\n");
-- 
2.13.1

>From 58dd9cc90d0b08450137f6afba719e7b87997710 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 28 Apr 2017 12:51:22 +0000
Subject: [PATCH 02/11] Backport r247375

gcc/ChangeLog:

2017-04-28  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/53915
	* gcov.c (format_gcov): Print 'NAN %' when top > bottom.
---
 gcc/gcov.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/gcov.c b/gcc/gcov.c
index fd65efff94e..79128ff50c0 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1768,6 +1768,13 @@ format_gcov (gcov_type top, gcov_type bottom, int dp)
 {
   static char buffer[20];
 
+  /* Handle invalid values that would result in a misleading value.  */
+  if (bottom != 0 && top > bottom && dp >= 0)
+    {
+      sprintf (buffer, "NAN %%");
+      return buffer;
+    }
+
   if (dp >= 0)
     {
       float ratio = bottom ? (float)top / bottom : 0;
-- 
2.13.1

>From 876c4e9ae6d39f046cc58de3c114cd24d618bc5c Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 28 Apr 2017 12:50:08 +0000
Subject: [PATCH 01/11] Backport r247371

gcc/ChangeLog:

2017-04-28  Martin Liska  <mliska@suse.cz>

	PR driver/56469
	* coverage.c (coverage_remove_note_file): New function.
	* coverage.h: Declare the function.
	* toplev.c (finalize): Clean if an error has been seen.
---
 gcc/coverage.c | 12 ++++++++++++
 gcc/coverage.h |  1 +
 gcc/toplev.c   |  3 +++
 3 files changed, 16 insertions(+)

diff --git a/gcc/coverage.c b/gcc/coverage.c
index 661e4411324..200c8633e54 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -767,6 +767,18 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
     }
 }
 
+/* Remove coverage file if opened.  */
+
+void
+coverage_remove_note_file (void)
+{
+  if (bbg_file_name)
+    {
+      gcov_close ();
+      unlink (bbg_file_name);
+    }
+}
+
 /* Build a coverage variable of TYPE for function FN_DECL.  If COUNTER
    >= 0 it is a counter array, otherwise it is the function structure.  */
 
diff --git a/gcc/coverage.h b/gcc/coverage.h
index bac242fd5a4..0ce4a46a3ba 100644
--- a/gcc/coverage.h
+++ b/gcc/coverage.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 
 extern void coverage_init (const char *);
 extern void coverage_finish (void);
+extern void coverage_remove_note_file (void);
 
 /* Start outputting coverage information for the current
    function.  */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index c565ea4797e..17d05121026 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1999,6 +1999,9 @@ finalize (bool no_backend)
   if (stack_usage_file)
     fclose (stack_usage_file);
 
+  if (seen_error ())
+    coverage_remove_note_file ();
+
   if (!no_backend)
     {
       statistics_fini ();
-- 
2.13.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]