public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: marxin <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Cc: hubicka@ucw.cz,    nathan@acm.org
Subject: [PATCH 1/8] gcno file: do not stream block flags (PR gcov-profile/80031).
Date: Fri, 28 Apr 2017 09:31:00 -0000	[thread overview]
Message-ID: <f3eb9bbb13f8e1d1b3d84ad64e82c7d9576c1ed0.1493371589.git.mliska@suse.cz> (raw)
In-Reply-To: <cover.1493371589.git.mliska@suse.cz>

gcc/ChangeLog:

2017-03-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/80031
	* gcov-dump.c (tag_blocks): Just print number of basic blocks.
	* gcov-io.h (GCOV_TAG_BLOCKS_NUM): Remove unused macro.
	* gcov.c (read_graph_file): Read just number of blocks.
	* profile.c (branch_prob): Do not stream 0 flags per a basic
	block.
---
 gcc/gcov-dump.c | 22 ++--------------------
 gcc/gcov-io.h   |  1 -
 gcc/gcov.c      |  7 +------
 gcc/profile.c   |  3 +--
 4 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index 47db1795313..f2522577e9d 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -318,27 +318,9 @@ tag_function (const char *filename ATTRIBUTE_UNUSED,
 static void
 tag_blocks (const char *filename ATTRIBUTE_UNUSED,
 	    unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED,
-	    unsigned depth)
+	    unsigned depth ATTRIBUTE_UNUSED)
 {
-  unsigned n_blocks = GCOV_TAG_BLOCKS_NUM (length);
-
-  printf (" %u blocks", n_blocks);
-
-  if (flag_dump_contents)
-    {
-      unsigned ix;
-
-      for (ix = 0; ix != n_blocks; ix++)
-	{
-	  if (!(ix & 7))
-	    {
-	      printf ("\n");
-	      print_prefix (filename, depth, gcov_position ());
-	      printf (VALUE_PADDING_PREFIX VALUE_PREFIX, ix);
-	    }
-	  printf ("%04x ", gcov_read_unsigned ());
-	}
-    }
+  printf (" %u blocks", gcov_read_unsigned ());
 }
 
 static void
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 1fb58dd918e..1c8ee8f9a2a 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -230,7 +230,6 @@ typedef uint64_t gcov_type_unsigned;
 #define GCOV_TAG_FUNCTION_LENGTH (3)
 #define GCOV_TAG_BLOCKS		 ((gcov_unsigned_t)0x01410000)
 #define GCOV_TAG_BLOCKS_LENGTH(NUM) (NUM)
-#define GCOV_TAG_BLOCKS_NUM(LENGTH) (LENGTH)
 #define GCOV_TAG_ARCS		 ((gcov_unsigned_t)0x01430000)
 #define GCOV_TAG_ARCS_LENGTH(NUM)  (1 + (NUM) * 2)
 #define GCOV_TAG_ARCS_NUM(LENGTH)  (((LENGTH) - 1) / 2)
diff --git a/gcc/gcov.c b/gcc/gcov.c
index bb26a1a9787..63f6a75f1af 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -129,7 +129,6 @@ typedef struct block_info
 
   /* Block execution count.  */
   gcov_type count;
-  unsigned flags : 12;
   unsigned count_valid : 1;
   unsigned valid_chain : 1;
   unsigned invalid_chain : 1;
@@ -1374,12 +1373,8 @@ read_graph_file (void)
 		     bbg_file_name, fn->name);
 	  else
 	    {
-	      unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length);
-	      fn->num_blocks = num_blocks;
-
+	      fn->num_blocks = gcov_read_unsigned ();
 	      fn->blocks = XCNEWVEC (block_t, fn->num_blocks);
-	      for (ix = 0; ix != num_blocks; ix++)
-		fn->blocks[ix].flags = gcov_read_unsigned ();
 	    }
 	}
       else if (fn && tag == GCOV_TAG_ARCS)
diff --git a/gcc/profile.c b/gcc/profile.c
index c6f462d2f7a..c7eed0e3dfd 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1195,8 +1195,7 @@ branch_prob (void)
 
       /* Basic block flags */
       offset = gcov_write_tag (GCOV_TAG_BLOCKS);
-      for (i = 0; i != (unsigned) (n_basic_blocks_for_fn (cfun)); i++)
-	gcov_write_unsigned (0);
+      gcov_write_unsigned (n_basic_blocks_for_fn (cfun));
       gcov_write_length (offset);
 
       /* Arcs */
-- 
2.12.2


  parent reply	other threads:[~2017-04-28  9:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  9:31 [PATCH 0/8] GCOV improvements marxin
2017-04-28  9:31 ` [PATCH 6/8] Fix format_gcov to not print misleading values (PR gcov-profile/53915) marxin
2017-04-28 11:38   ` Nathan Sidwell
2017-04-28  9:31 ` marxin [this message]
2017-04-28 11:48   ` [PATCH 1/8] gcno file: do not stream block flags (PR gcov-profile/80031) Nathan Sidwell
2017-04-28  9:31 ` [PATCH 4/8] Introduce new option -w which shows verbose informations marxin
2017-04-28 11:41   ` Nathan Sidwell
2017-04-28  9:31 ` [PATCH 5/8] Make gcno more precise about BBs really belonging to a line (PR gcov-profile/79891) marxin
2017-04-28 11:47   ` Nathan Sidwell
2017-04-28 13:06     ` Martin Liška
2017-04-28  9:31 ` [PATCH 2/8] Remove .gcno file when compilation does not success (PR driver/56469) marxin
2017-04-28 12:00   ` Nathan Sidwell
2017-04-28 10:58 ` [PATCH 7/8] Sort options of gcov, gcov-dump and gcov-tool both in --help and documentation marxin
2017-04-28 11:32   ` Nathan Sidwell
2017-04-28 11:25 ` [PATCH 8/8] Enhance documentation of gcov marxin
2017-04-28 11:35   ` Nathan Sidwell
2017-04-29  3:20   ` Martin Sebor
2018-07-22  8:40     ` Gerald Pfeifer
2017-04-28 11:26 ` [PATCH 3/8] Simplify representation of locations of a block marxin
2017-04-28 11:57   ` Nathan Sidwell
2017-04-28 16:40     ` Martin Sebor
2017-04-28 17:48       ` Nathan Sidwell
2017-05-02 15:38         ` [PATCH] Fix documentation and a ctor in gcov.c Martin Liška
2017-05-03 13:20           ` Nathan Sidwell
2017-04-28 19:13       ` [PATCH 3/8] Simplify representation of locations of a block Pedro Alves
2017-04-28 19:46         ` Martin Sebor
2017-04-28 20:07         ` Pedro Alves
2017-04-28 12:03 ` [PATCH 0/8] GCOV improvements Nathan Sidwell
2017-04-28 12:16   ` Martin Liška
2017-04-29 16:31     ` Gerald Pfeifer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3eb9bbb13f8e1d1b3d84ad64e82c7d9576c1ed0.1493371589.git.mliska@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=nathan@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).