]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcov: fix streaming of HIST_TYPE_IOR histogram type.
authorMartin Liska <mliska@suse.cz>
Fri, 25 Sep 2020 14:21:34 +0000 (16:21 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 1 Oct 2020 19:19:14 +0000 (21:19 +0200)
gcc/ChangeLog:

PR gcov-profile/64636
* value-prof.c (stream_out_histogram_value): Allow negative
values for HIST_TYPE_IOR.

(cherry picked from commit 1921ebcaf6467996aede69e1bbe32400d8a20fe7)

gcc/value-prof.c

index 45677be46b1ea211b905cb31f86db57d914726d7..9d60b56c43aa6c17ef36befd641c4ea384e49238 100644 (file)
@@ -332,7 +332,10 @@ stream_out_histogram_value (struct output_block *ob, histogram_value hist)
       /* When user uses an unsigned type with a big value, constant converted
         to gcov_type (a signed type) can be negative.  */
       gcov_type value = hist->hvalue.counters[i];
-      if (hist->type == HIST_TYPE_TOPN_VALUES)
+      if (hist->type == HIST_TYPE_TOPN_VALUES
+         || hist->type == HIST_TYPE_IOR)
+       /* Note that the IOR counter tracks pointer values and these can have
+          sign bit set.  */
        ;
       else
        gcc_assert (value >= 0);