The bug in scaling profile of fnsplit produced clones made
some afdo counts during gcc bootstrap very large (2^59).
This made computations in ipa-profile to silently overflow
which triggered hot count to be identified as 1 instead of
sane value.
While fixing the fnsplit bug prevents overflow, I think the histogram code
should be made safe too. sreal is not very fitting here since mantisa is 32bit
and not very good for many additions of many numbers which are possibly of very
different order. So I use widest_int while 128bit arithmetics would be safe
(we are summing 60 bit counts multiplied by time estimates). I don't think
we have readily available 128bit type and code is not really time critical since
the histogram is computed once.
gcc/ChangeLog:
* ipa-profile.cc (ipa_profile): Use widest_int to avoid
possible overflows.