diff mbox series

GCC 9 backports

Message ID 97ec7d16-eebe-4124-7018-22242c76a797@suse.cz
State New
Headers show
Series GCC 9 backports | expand

Commit Message

Martin Liška May 14, 2019, 8:45 a.m. UTC
Hi.

There are 2 backport patches that I've just tested and I'm going to install them.

Martin

Comments

Martin Liška May 14, 2019, 8:47 a.m. UTC | #1
On 5/14/19 10:45 AM, Martin Liška wrote:
> Hi.
> 
> There are 2 backport patches that I've just tested and I'm going to install them.
> 
> Martin
> 

One more patch.

Martin
Martin Liška May 24, 2019, 7:43 a.m. UTC | #2
Hi.

I'm sending one more patch that I've tested.

Martin
Martin Liška July 4, 2019, 9:01 a.m. UTC | #3
Hi.

There are 2 more patches that I've just tested.

Martin
Martin Liška July 22, 2019, 9:35 a.m. UTC | #4
Hi.

One more patch I've just tested.

Martin
Martin Liška Aug. 23, 2019, 11:40 a.m. UTC | #5
There are 3 more tested patches that I going to backport.

Martin
Martin Liška Sept. 2, 2019, 8:56 a.m. UTC | #6
Hi.

There are 2 more patches that I've just tested.

Martin
Martin Liška Oct. 23, 2019, 12:11 p.m. UTC | #7
On 9/2/19 10:56 AM, Martin Liška wrote:
> Hi.
> 
> There are 2 more patches that I've just tested.
> 
> Martin

Hi.

There are 2 more patches that I've just tested.

Martin
Martin Liška Feb. 28, 2020, 5:51 p.m. UTC | #8
On 10/23/19 2:11 PM, Martin Liška wrote:
> On 9/2/19 10:56 AM, Martin Liška wrote:
>> Hi.
>>
>> There are 2 more patches that I've just tested.
>>
>> Martin
> 
> Hi.
> 
> There are 2 more patches that I've just tested.
> 
> Martin
> 

Hi.

There's one more patch.

Martin
Martin Liška March 10, 2020, 10:09 a.m. UTC | #9
Hi.

One more that I've just tested.

Martin
Martin Liška April 3, 2020, 10:32 a.m. UTC | #10
Hi.

There's one more I've tested.

Martin
Martin Liška April 20, 2020, 9:25 a.m. UTC | #11
On 4/3/20 12:32 PM, Martin Liška wrote:
> Hi.
> 
> There's one more I've tested.
> 
> Martin

And one more.

Martin
Martin Liška Oct. 2, 2020, 10:05 a.m. UTC | #12
There are 2 more I've just tested.

Martin
Martin Liška Oct. 2, 2020, 11:15 a.m. UTC | #13
On 10/2/20 12:05 PM, Martin Liška wrote:
> There are 2 more I've just tested.
> 
> Martin

and one more.

Martin
Martin Liška Oct. 15, 2020, 9:07 a.m. UTC | #14
On 10/2/20 1:15 PM, Martin Liška wrote:
> On 10/2/20 12:05 PM, Martin Liška wrote:
>> There are 2 more I've just tested.
>>
>> Martin
> 
> and one more.
> 
> Martin

and one more.

Martin
Martin Liška Oct. 16, 2020, 8:51 a.m. UTC | #15
On 10/2/20 1:15 PM, Martin Liška wrote:
> On 10/2/20 12:05 PM, Martin Liška wrote:
>> There are 2 more I've just tested.
>>
>> Martin
> 
> and one more.
> 
> Martin

Adding one more.

Martin
diff mbox series

Patch

From b566f10c6650baabc72cf090a08774936b1f703b Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 13 May 2019 07:05:23 +0000
Subject: [PATCH 2/2] Backport r271117

gcc/ChangeLog:

2019-05-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/90380
	* gcov.c (handle_cycle): Do not support zero cycle count,
	it should not be possible.
	(path_contains_zero_cycle_arc): New function.
	(circuit): Ignore zero cycle arc counts.
---
 gcc/gcov.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/gcc/gcov.c b/gcc/gcov.c
index 6bcd2b23748..b06a6714c2e 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -696,7 +696,7 @@  handle_cycle (const arc_vector_t &edges, int64_t &count)
   for (unsigned i = 0; i < edges.size (); i++)
     edges[i]->cs_count -= cycle_count;
 
-  gcc_assert (cycle_count >= 0);
+  gcc_assert (cycle_count > 0);
 }
 
 /* Unblock a block U from BLOCKED.  Apart from that, iterate all blocks
@@ -722,6 +722,17 @@  unblock (const block_info *u, block_vector_t &blocked,
     unblock (*it, blocked, block_lists);
 }
 
+/* Return true when PATH contains a zero cycle arc count.  */
+
+static bool
+path_contains_zero_cycle_arc (arc_vector_t &path)
+{
+  for (unsigned i = 0; i < path.size (); i++)
+    if (path[i]->cs_count == 0)
+      return true;
+  return false;
+}
+
 /* Find circuit going to block V, PATH is provisional seen cycle.
    BLOCKED is vector of blocked vertices, BLOCK_LISTS contains vertices
    blocked by a block.  COUNT is accumulated count of the current LINE.
@@ -742,7 +753,9 @@  circuit (block_info *v, arc_vector_t &path, block_info *start,
   for (arc_info *arc = v->succ; arc; arc = arc->succ_next)
     {
       block_info *w = arc->dst;
-      if (w < start || !linfo.has_block (w))
+      if (w < start
+	  || arc->cs_count == 0
+	  || !linfo.has_block (w))
 	continue;
 
       path.push_back (arc);
@@ -752,7 +765,8 @@  circuit (block_info *v, arc_vector_t &path, block_info *start,
 	  handle_cycle (path, count);
 	  loop_found = true;
 	}
-      else if (find (blocked.begin (), blocked.end (), w) == blocked.end ())
+      else if (!path_contains_zero_cycle_arc (path)
+	       &&  find (blocked.begin (), blocked.end (), w) == blocked.end ())
 	loop_found |= circuit (w, path, start, blocked, block_lists, linfo,
 			       count);
 
@@ -765,7 +779,9 @@  circuit (block_info *v, arc_vector_t &path, block_info *start,
     for (arc_info *arc = v->succ; arc; arc = arc->succ_next)
       {
 	block_info *w = arc->dst;
-	if (w < start || !linfo.has_block (w))
+	if (w < start
+	    || arc->cs_count == 0
+	    || !linfo.has_block (w))
 	  continue;
 
 	size_t index
-- 
2.21.0