diff options
author | Richard Henderson <rth@redhat.com> | 2002-04-04 13:38:40 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-04-04 13:38:40 -0800 |
commit | 3900216066f8f2b9a8362daf4da8b225018e69d7 (patch) | |
tree | 7cd87ed9f891b016d4e3034c5be3cdf5408bf6d7 /gcc/predict.c | |
parent | 677b3ae39a0420e00430245ad9d32c31b60eb82c (diff) | |
download | gcc-3900216066f8f2b9a8362daf4da8b225018e69d7.zip gcc-3900216066f8f2b9a8362daf4da8b225018e69d7.tar.gz gcc-3900216066f8f2b9a8362daf4da8b225018e69d7.tar.bz2 |
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
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index 56b0436..1d8691c 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 (); |