diff mbox series

[2/2] Do not follow zero edges in cycle detection (PR gcov-profile/90380).

Message ID 0da1246c62a13ed2e85cf5385b6885ad73750fd7.1557407113.git.mliska@suse.cz
State New
Headers show
Series gcov for huge cyclic graph (PR gcov-profile/90380) | expand

Commit Message

Martin Liška May 9, 2019, 8:12 a.m. UTC
gcc/ChangeLog:

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

	* gcov.c (circuit): Ignore zero count arcs.
---
 gcc/gcov.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Martin Liška May 10, 2019, 1:42 p.m. UTC | #1
On 5/9/19 10:12 AM, marxin wrote:
> 
> gcc/ChangeLog:
> 
> 2019-05-09  Martin Liska  <mliska@suse.cz>
> 
> 	* gcov.c (circuit): Ignore zero count arcs.
> ---
>  gcc/gcov.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

Hi.

There's second version of the patch that was confirmed by the reported
that works fine.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Thanks,
Martin
diff mbox series

Patch

diff --git a/gcc/gcov.c b/gcc/gcov.c
index 6bcd2b23748..f409d67e12c 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -742,7 +742,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->count == 0
+	  || !linfo.has_block (w))
 	continue;
 
       path.push_back (arc);
@@ -765,7 +767,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->count == 0
+	    || !linfo.has_block (w))
 	  continue;
 
 	size_t index