Blame SOURCES/gcc8-pr91601.patch

428290
2020-03-29  Martin Liska  <mliska@suse.cz>
428290
428290
	Backport from mainline
428290
	2019-09-02  Martin Liska  <mliska@suse.cz>
428290
428290
	PR gcov-profile/91601
428290
	* gcov.c (path_contains_zero_cycle_arc): Rename to ...
428290
	(path_contains_zero_or_negative_cycle_arc): ... this and handle
428290
	also negative edges.
428290
	(circuit): Handle also negative edges as they can happen
428290
	in some situations.
428290
428290
--- gcc/gcov.c
428290
+++ gcc/gcov.c
428290
@@ -653,10 +653,10 @@ unblock (const block_info *u, block_vector_t &blocked,
428290
 /* Return true when PATH contains a zero cycle arc count.  */
428290
 
428290
 static bool
428290
-path_contains_zero_cycle_arc (arc_vector_t &path)
428290
+path_contains_zero_or_negative_cycle_arc (arc_vector_t &path)
428290
 {
428290
   for (unsigned i = 0; i < path.size (); i++)
428290
-    if (path[i]->cs_count == 0)
428290
+    if (path[i]->cs_count <= 0)
428290
       return true;
428290
   return false;
428290
 }
428290
@@ -682,7 +682,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
428290
     {
428290
       block_info *w = arc->dst;
428290
       if (w < start
428290
-	  || arc->cs_count == 0
428290
+	  || arc->cs_count <= 0
428290
 	  || !linfo.has_block (w))
428290
 	continue;
428290
 
428290
@@ -693,7 +693,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
428290
 	  handle_cycle (path, count);
428290
 	  loop_found = true;
428290
 	}
428290
-      else if (!path_contains_zero_cycle_arc (path)
428290
+      else if (!path_contains_zero_or_negative_cycle_arc (path)
428290
 	       &&  find (blocked.begin (), blocked.end (), w) == blocked.end ())
428290
 	loop_found |= circuit (w, path, start, blocked, block_lists, linfo,
428290
 			       count);
428290
@@ -708,7 +708,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
428290
       {
428290
 	block_info *w = arc->dst;
428290
 	if (w < start
428290
-	    || arc->cs_count == 0
428290
+	    || arc->cs_count <= 0
428290
 	    || !linfo.has_block (w))
428290
 	  continue;
428290