]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This fixes part of the issue described in PR gcov-profile/54487 where there...
authorTeresa Johnson <tejohnson@google.com>
Fri, 7 Sep 2012 13:49:47 +0000 (13:49 +0000)
committerTeresa Johnson <tejohnson@gcc.gnu.org>
Fri, 7 Sep 2012 13:49:47 +0000 (13:49 +0000)
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

libgcc/ChangeLog
libgcc/libgcov.c

index 7ffb58c3d245cdffc9e031820d4b8ccbfb13a7ff..cc030f2640ac6a70b5d7537a1360919be966ab17 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-07  Teresa Johnson  <tejohnson@google.com>
+
+        PR gcov-profile/54487
+       * libgcc/libgcov.c (gcov_exit): Avoid warning on histogram
+        differences.
+
 2012-09-05  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/54461
index fce8587affe3c30e38f382be5444aa8ed38e2708..c58427e753bb57eee491def0567d4edc4a4d9fd2 100644 (file)
@@ -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