diff options
author | Teresa Johnson <tejohnson@google.com> | 2012-09-07 13:49:47 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@gcc.gnu.org> | 2012-09-07 13:49:47 +0000 |
commit | c6c36e7310e6b67f2c37f0dabc6852c2b50c7a3c (patch) | |
tree | c39d7334f52a5e6331db1c4a7f53a91d5887df86 /libgcc/libgcov.c | |
parent | 48d3d75d39df4bd391c3e89f9e31df505c672151 (diff) | |
download | gcc-c6c36e7310e6b67f2c37f0dabc6852c2b50c7a3c.tar.gz |
This fixes part of the issue described in PR gcov-profile/54487 where there...
This fixes part of the issue described in PR gcov-profile/54487 where
there were warnings about mismatches due to slight differences in the
merged histograms in different object files. This can happen due to
the truncating integer division in the merge routine, which could result
in slightly different histograms when summaries are merged in different
orders.
2012-09-07 Teresa Johnson <tejohnson@google.com>
PR gcov-profile/54487
* libgcc/libgcov.c (gcov_exit): Avoid warning on histogram
differences.
From-SVN: r191074
Diffstat (limited to 'libgcc/libgcov.c')
-rw-r--r-- | libgcc/libgcov.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgcc/libgcov.c b/libgcc/libgcov.c index fce8587affe..c58427e753b 100644 --- a/libgcc/libgcov.c +++ b/libgcc/libgcov.c @@ -707,7 +707,13 @@ gcov_exit (void) memcpy (cs_all, cs_prg, sizeof (*cs_all)); else if (!all_prg.checksum && (!GCOV_LOCKED || cs_all->runs == cs_prg->runs) - && memcmp (cs_all, cs_prg, sizeof (*cs_all))) + /* Don't compare the histograms, which may have slight + variations depending on the order they were updated + due to the truncating integer divides used in the + merge. */ + && memcmp (cs_all, cs_prg, + sizeof (*cs_all) - (sizeof (gcov_bucket_type) + * GCOV_HISTOGRAM_SIZE))) { fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s\n", gi_filename, GCOV_LOCKED |