[gcc(refs/users/marxin/heads/PR96919-patch-candidate)] WIP - regresses on tramp3d.

Martin Liska marxin@gcc.gnu.org
Thu Jan 7 13:33:43 GMT 2021


https://gcc.gnu.org/g:37447ace3c7b222ffde9c8f6633288917c5bc276

commit 37447ace3c7b222ffde9c8f6633288917c5bc276
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jan 7 14:33:23 2021 +0100

    WIP - regresses on tramp3d.

Diff:
---
 gcc/gcov.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/gcov.c b/gcc/gcov.c
index 01ca52b215d..29c5e6bdc00 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -208,7 +208,7 @@ public:
   /* Branches from blocks that end on this line.  */
   vector<arc_info *> branches;
 
-  /* blocks which start on this line.  Used in all-blocks mode.  */
+  /* Blocks which contain this line.  */
   vector<block_info *> blocks;
 
   unsigned exists : 1;
@@ -1785,6 +1785,7 @@ read_graph_file (void)
       else if (fn && tag == GCOV_TAG_ARCS)
 	{
 	  unsigned src = gcov_read_unsigned ();
+	  /* Mark ID of a source block.  */
 	  fn->blocks[src].id = src;
 	  unsigned num_dests = GCOV_TAG_ARCS_NUM (length);
 	  block_info *src_blk = &fn->blocks[src];
@@ -1804,6 +1805,8 @@ read_graph_file (void)
 	      arc = XCNEW (arc_info);
 
 	      arc->dst = &fn->blocks[dest];
+	      /* Mark ID of target block, needed for EXIT_BB.  */
+	      fn->blocks[dest].id = dest;
 	      arc->src = src_blk;
 
 	      arc->count = 0;
@@ -2639,6 +2642,8 @@ add_line_counts (coverage_info *coverage, function_info *fn)
 			line->has_unexecuted_block = 1;
 		    }
 		  line->count += block->count;
+		  gcc_assert (!line->has_block (block));
+		  line->blocks.push_back (block);
 		}
 	      else
 		{
@@ -2659,6 +2664,8 @@ add_line_counts (coverage_info *coverage, function_info *fn)
 			line->has_unexecuted_block = 1;
 		    }
 		  line->count += block->count;
+		  gcc_assert (!line->has_block (block));
+		  line->blocks.push_back (block);
 		}
 	    }
 
@@ -2668,8 +2675,6 @@ add_line_counts (coverage_info *coverage, function_info *fn)
 	    /* Entry or exit block.  */;
 	  else if (line != NULL)
 	    {
-	      line->blocks.push_back (block);
-
 	      if (flag_branches)
 		{
 		  arc_info *arc;


More information about the Gcc-cvs mailing list