From 3900216066f8f2b9a8362daf4da8b225018e69d7 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 4 Apr 2002 13:38:40 -0800 Subject: [PATCH] predict.c (estimate_bb_frequencies): Do frequency calculation with a volatile temporary. * predict.c (estimate_bb_frequencies): Do frequency calculation with a volatile temporary. From-SVN: r51879 --- gcc/ChangeLog | 5 +++++ gcc/predict.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c9f421303a8..23e407a49dec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-04-04 Richard Henderson + + * predict.c (estimate_bb_frequencies): Do frequency calculation + with a volatile temporary. + 2002-04-04 Ulrich Weigand * config/s390/linux.h (LOCAL_LABEL_PREFIX): Define. diff --git a/gcc/predict.c b/gcc/predict.c index 56b04365b3f7..1d8691c9d222 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -942,6 +942,7 @@ estimate_bb_frequencies (loops) for (i = -2; i < n_basic_blocks; i++) { basic_block bb; + volatile double tmp; if (i == -2) bb = ENTRY_BLOCK_PTR; @@ -949,8 +950,12 @@ estimate_bb_frequencies (loops) bb = EXIT_BLOCK_PTR; else bb = BASIC_BLOCK (i); - bb->frequency - = BLOCK_INFO (bb)->frequency * BB_FREQ_MAX / freq_max + 0.5; + + /* ??? Prevent rounding differences due to optimization on x86. */ + tmp = BLOCK_INFO (bb)->frequency * BB_FREQ_MAX; + tmp /= freq_max; + tmp += 0.5; + bb->frequency = tmp; } free_aux_for_blocks (); -- 2.43.5