From 59c7b29e9a5b3a692efae81541985be800cdbf0c Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 10 Dec 2019 17:54:41 +0000 Subject: Turn tp_first_run counts back to 32bit values. * cgraph.c (cgraph_node::verify_node): Verify tp_first_run. * cgraph.h (cgrpah_node): Turn tp_first_run back to int. * cgraphunit.c (tp_first_run_node_cmp): Do not watch for overflows. (expand_all_functions): First expand ordered section and then unordered. * lto-partition.c (lto_balanced_map): Fix printing of tp_first_run. * profile.c (compute_value_histograms): Error on out of range tp_first_runs. From-SVN: r279178 --- gcc/profile.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/profile.c') diff --git a/gcc/profile.c b/gcc/profile.c index 7d412171222..e300ba6d589 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -871,11 +871,18 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum, if (hist->type == HIST_TYPE_TIME_PROFILE) { node = cgraph_node::get (hist->fun->decl); - node->tp_first_run = hist->hvalue.counters[0]; + if (hist->hvalue.counters[0] >= 0 + && hist->hvalue.counters[0] < INT_MAX / 2) + node->tp_first_run = hist->hvalue.counters[0]; + else + { + if (flag_profile_correction) + error ("corrupted profile info: invalid time profile"); + node->tp_first_run = 0; + } if (dump_file) - fprintf (dump_file, "Read tp_first_run: %" PRId64 "\n", - (int64_t) node->tp_first_run); + fprintf (dump_file, "Read tp_first_run: %d\n", node->tp_first_run); } } -- cgit v1.2.3