This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/2] Do not follow zero edges in cycle detection (PR gcov-profile/90380).
- From: marxin <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 May 2019 10:12:42 +0200
- Subject: [PATCH 2/2] Do not follow zero edges in cycle detection (PR gcov-profile/90380).
- References: <cover.1557407113.git.mliska@suse.cz>
- Resent-user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
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(-)
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