diff options
author | Jan Hubicka <jh@suse.cz> | 2023-07-21 16:50:49 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2023-07-21 16:51:46 +0200 |
commit | feeee84079ee165f13f9fb8cdcf5dcea98d394e0 (patch) | |
tree | b1690f1a312f0b3b6186dd732d815e0b1d9115d0 /gcc/cfgloop.cc | |
parent | fc92f5811e77b091d65045f2daa0f83c31d00797 (diff) | |
download | gcc-feeee84079ee165f13f9fb8cdcf5dcea98d394e0.zip gcc-feeee84079ee165f13f9fb8cdcf5dcea98d394e0.tar.gz gcc-feeee84079ee165f13f9fb8cdcf5dcea98d394e0.tar.bz2 |
Use sreal::nearest_int
Fix conversions from sreal to nearest integer.
gcc/ChangeLog:
* cfgloop.cc (get_estimated_loop_iterations): Use sreal::to_nearest_int
* cfgloopanal.cc (expected_loop_iterations_unbounded): Likewise.
* predict.cc (estimate_bb_frequencies): Likewise.
* profile.cc (branch_prob): Likewise.
* tree-ssa-loop-niter.cc (estimate_numbers_of_iterations): Likewise
Diffstat (limited to 'gcc/cfgloop.cc')
-rw-r--r-- | gcc/cfgloop.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cfgloop.cc b/gcc/cfgloop.cc index 9ca85e6..6d46b5b 100644 --- a/gcc/cfgloop.cc +++ b/gcc/cfgloop.cc @@ -2012,7 +2012,7 @@ get_estimated_loop_iterations (class loop *loop, widest_int *nit) if (expected_loop_iterations_by_profile (loop, &snit, &reliable) && reliable) { - *nit = (snit + 0.5).to_int (); + *nit = snit.to_nearest_int (); return true; } return false; |