aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloop.cc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2023-07-21 16:50:49 +0200
committerJan Hubicka <jh@suse.cz>2023-07-21 16:51:46 +0200
commitfeeee84079ee165f13f9fb8cdcf5dcea98d394e0 (patch)
treeb1690f1a312f0b3b6186dd732d815e0b1d9115d0 /gcc/cfgloop.cc
parentfc92f5811e77b091d65045f2daa0f83c31d00797 (diff)
downloadgcc-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.cc2
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;