Commit 1a482881 by Nathan Sidwell Committed by Nathan Sidwell

* gcov.c (accumulate_line_counts): Fix span tree merge bug.

From-SVN: r65245
parent 941747b5
2003-04-04 Nathan Sidwell <nathan@codesourcery.com>
* gcov.c (accumulate_line_counts): Fix span tree merge bug.
Fri Apr 4 15:58:52 2003 J"orn Rennecke <joern.rennecke@superh.com> Fri Apr 4 15:58:52 2003 J"orn Rennecke <joern.rennecke@superh.com>
* sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of * sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of
......
...@@ -1699,21 +1699,24 @@ accumulate_line_counts (src) ...@@ -1699,21 +1699,24 @@ accumulate_line_counts (src)
{ {
block_t *root = block->u.span.root; block_t *root = block->u.span.root;
block_t *dst_root = dst->u.span.root; block_t *dst_root = dst->u.span.root;
/* Join spanning trees */ /* Join spanning trees */
if (root->u.span.siblings && !dst_root->u.span.root) if (root->u.span.siblings
&& !dst_root->u.span.siblings)
{ {
root = dst->u.span.root; root = dst->u.span.root;
dst_root = block->u.span.root; dst_root = block->u.span.root;
} }
dst->u.span.root = root; dst_root->u.span.root = root;
root->u.span.siblings += 1 + dst->u.span.siblings; root->u.span.siblings
if (dst->u.span.siblings) += 1 + dst_root->u.span.siblings;
if (dst_root->u.span.siblings)
{ {
block_t *dst_sib; block_t *dst_sib;
dst->u.span.siblings = 0; dst_root->u.span.siblings = 0;
for (dst_sib = line->u.blocks; dst_sib; for (dst_sib = line->u.blocks; dst_sib;
dst_sib = dst_sib->chain) dst_sib = dst_sib->chain)
if (dst_sib->u.span.root == dst_root) if (dst_sib->u.span.root == dst_root)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment