summaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2019-12-10 17:54:41 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2019-12-10 17:54:41 +0000
commit59c7b29e9a5b3a692efae81541985be800cdbf0c (patch)
treef2bb1ec7b0e6ac6ba92cb44f3193d2a12f761625 /gcc/profile.c
parent066564270000d608114fdea89cfbf58c69f68845 (diff)
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
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c13
1 files changed, 10 insertions, 3 deletions
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);
}
}