* [PATCH] gcov: fix streaming of HIST_TYPE_IOR histogram type.
@ 2020-09-25 14:26 Martin Liška
0 siblings, 0 replies; only message in thread
From: Martin Liška @ 2020-09-25 14:26 UTC (permalink / raw)
To: gcc-patches
Hello.
I'm going to install quite obvious patch which allow negative values
for HIST_TYPE_IOR as it tracks pointers.
Martin
gcc/ChangeLog:
PR gcov-profile/64636
* value-prof.c (stream_out_histogram_value): Allow negative
values for HIST_TYPE_IOR.
---
gcc/value-prof.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index ea1b1a8f98f..95d33c63a0c 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -331,7 +331,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);
--
2.28.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-25 14:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 14:26 [PATCH] gcov: fix streaming of HIST_TYPE_IOR histogram type Martin Liška
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).