diff options
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 (); |