This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcov]: Fix span tree bug
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 04 Apr 2003 16:47:17 +0100
- Subject: [gcov]: Fix span tree bug
- Organization: Codesourcery LLC
Hi,
I've installed the attached obvious (after a bit of head scratching) patch.
It fixes a fault with my recent block mode flag.
built & tested on i686-pc-linux-gnu with cp/decl.c's graph
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org
2003-04-04 Nathan Sidwell <nathan at codesourcery dot com>
* gcov.c (accumulate_line_counts): Fix span tree merge bug.
Index: gcov.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcov.c,v
retrieving revision 1.54
diff -c -3 -p -r1.54 gcov.c
*** gcov.c 31 Mar 2003 15:18:23 -0000 1.54
--- gcov.c 4 Apr 2003 15:42:59 -0000
*************** accumulate_line_counts (src)
*** 1699,1719 ****
{
block_t *root = block->u.span.root;
block_t *dst_root = dst->u.span.root;
!
/* Join spanning trees */
! if (root->u.span.siblings && !dst_root->u.span.root)
{
root = dst->u.span.root;
dst_root = block->u.span.root;
}
! dst->u.span.root = root;
! root->u.span.siblings += 1 + dst->u.span.siblings;
! if (dst->u.span.siblings)
{
block_t *dst_sib;
! dst->u.span.siblings = 0;
for (dst_sib = line->u.blocks; dst_sib;
dst_sib = dst_sib->chain)
if (dst_sib->u.span.root == dst_root)
--- 1697,1720 ----
{
block_t *root = block->u.span.root;
block_t *dst_root = dst->u.span.root;
!
/* Join spanning trees */
! if (root->u.span.siblings
! && !dst_root->u.span.siblings)
{
root = dst->u.span.root;
dst_root = block->u.span.root;
}
! dst_root->u.span.root = root;
! root->u.span.siblings
! += 1 + dst_root->u.span.siblings;
!
! if (dst_root->u.span.siblings)
{
block_t *dst_sib;
! dst_root->u.span.siblings = 0;
for (dst_sib = line->u.blocks; dst_sib;
dst_sib = dst_sib->chain)
if (dst_sib->u.span.root == dst_root)