public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcov: annotate uncovered branches [PR107537]
@ 2022-12-14 20:03 Michael Förderer
  2022-12-15 11:00 ` Martin Liška
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Förderer @ 2022-12-14 20:03 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

Dear all,

this is a patch to print the gcov annotations (fallthrough or throw) als
to uncovered branches.


Best regards,

Michael

[-- Attachment #2: 0001-gcov-annotate-uncovered-branches-PR107537.patch --]
[-- Type: text/plain, Size: 1174 bytes --]

From b65cfc8a837cd9d1b6421978865210e59ba62e0e Mon Sep 17 00:00:00 2001
From: Spacetown <michael.foerderer@gmx.de>
Date: Sun, 4 Dec 2022 21:03:34 +0100
Subject: [PATCH] gcov: annotate uncovered branches [PR107537]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

gcc/ChangeLog:
    PR gcc/107537
	* gcov.cc (output_branch_count): Add annotation '(fallthrough)' or '(throw)' also to uncovered branches.

Signed-off-by: Michael Förderer <michael.foerderer@gmx.de>
---
 gcc/gcov.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/gcov.cc b/gcc/gcov.cc
index 9cf1071166f..5314be8a887 100644
--- a/gcc/gcov.cc
+++ b/gcc/gcov.cc
@@ -2893,7 +2893,9 @@ output_branch_count (FILE *gcov_file, int ix, const arc_info *arc)
 		 arc->fall_through ? " (fallthrough)"
 		 : arc->is_throw ? " (throw)" : "");
       else
-	fnotice (gcov_file, "branch %2d never executed", ix);
+	fnotice (gcov_file, "branch %2d never executed%s", ix,
+     arc->fall_through ? " (fallthrough)"
+		 : arc->is_throw ? " (throw)" : "");
 
       if (flag_verbose)
 	fnotice (gcov_file, " (BB %d)", arc->dst->id);
-- 
2.32.1 (Apple Git-133)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gcov: annotate uncovered branches [PR107537]
  2022-12-14 20:03 [PATCH] gcov: annotate uncovered branches [PR107537] Michael Förderer
@ 2022-12-15 11:00 ` Martin Liška
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liška @ 2022-12-15 11:00 UTC (permalink / raw)
  To: Michael Förderer, gcc-patches

On 12/14/22 21:03, Michael Förderer via Gcc-patches wrote:
> Dear all,
> 
> this is a patch to print the gcov annotations (fallthrough or throw) als
> to uncovered branches.

Hey.

It's fine and I've just pushed the revision on your behalf:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=c263c3eba8953c341cd8ac2d0a5f2b8f38623016

Thanks for you contribution.
Martin

> 
> 
> Best regards,
> 
> Michael


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-15 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14 20:03 [PATCH] gcov: annotate uncovered branches [PR107537] Michael Förderer
2022-12-15 11:00 ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).