summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 1c5d7dd7556..5d801d35921 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -226,8 +226,10 @@ select_best_block (basic_block early_bb,
/* If BEST_BB is at the same nesting level, then require it to have
significantly lower execution frequency to avoid gratutious movement. */
if (bb_loop_depth (best_bb) == bb_loop_depth (early_bb)
- && best_bb->count.to_frequency (cfun)
- < (early_bb->count.to_frequency (cfun) * threshold / 100.0))
+ /* If result of comparsion is unknown, preffer EARLY_BB.
+ Thus use !(...>=..) rather than (...<...) */
+ && !(best_bb->count.apply_scale (100, 1)
+ > (early_bb->count.apply_scale (threshold, 1))))
return best_bb;
/* No better block found, so return EARLY_BB, which happens to be the