diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-04 15:48:19 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-04 15:48:19 +0000 |
commit | 30c3f31b20feb5ed9c4ca22d4290b69e4b1b15ff (patch) | |
tree | 81b52562f56ffa26d6eaced9b95742cd159dc5df | |
parent | b99fa5c1a69b7f0d5d9aa39ce0f75f0ddb862cc1 (diff) | |
download | gcc-30c3f31b20feb5ed9c4ca22d4290b69e4b1b15ff.tar.gz |
* gcov.c (accumulate_line_counts): Fix span tree merge bug.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65245 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/gcov.c | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6317830cd78..822d403f6c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +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> * sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of diff --git a/gcc/gcov.c b/gcc/gcov.c index 964e5e84be9..e986ac13bd7 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1699,21 +1699,24 @@ accumulate_line_counts (src) { 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) + if (root->u.span.siblings + && !dst_root->u.span.siblings) { 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) + 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->u.span.siblings = 0; + 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) |