Skip to content

Commit

Permalink
gcov: fix streaming of HIST_TYPE_IOR histogram type.
Browse files Browse the repository at this point in the history
gcc/ChangeLog:

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

(cherry picked from commit 1921ebc)
  • Loading branch information
marxin committed Oct 1, 2020
1 parent b62c649 commit 84dc387
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gcc/value-prof.c
Expand Up @@ -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);
Expand Down

0 comments on commit 84dc387

Please sign in to comment.