]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix overflow in ipa_profile_generate_summary
authorJan Hubicka <hubicka@ucw.cz>
Tue, 30 Sep 2025 11:07:53 +0000 (13:07 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Tue, 30 Sep 2025 11:09:46 +0000 (13:09 +0200)
commit69ac957ea56ad4b98baa8a6ca52ad0729b3358e0
tree68133aa60d494f7ae08151a11f8726233d995316
parent5bf08863328955a688c3bf9236fb041f1b909392
Fix overflow in ipa_profile_generate_summary

With profile count scaling we now get overflow in ipa_profile_generate_summary
which uses old macro GCOV_COMPUTE_SCALE that is not ready for very large
counts.  This patch replaces remaining two uses of it by (somewhat elaborate)
profile-count based equivalent which is overflow safe.

gcc/ChangeLog:

* basic-block.h (GCOV_COMPUTE_SCALE): Remove.
* ipa-profile.cc (ipa_profile_generate_summary): Use
profile-count scaling.
* sched-rgn.cc (compute_trg_info): Likewise.
gcc/basic-block.h
gcc/ipa-profile.cc
gcc/sched-rgn.cc