diff options
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 648c4a4f7c3..d13e6be9bab 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -446,6 +446,14 @@ try_forward_edges (int mode, basic_block b) target = first = e->dest; counter = 0; + /* If we are partitioning hot/cold basic_blocks, we don't want to mess + up jumps that cross between hot/cold sections. */ + + if (flag_reorder_blocks_and_partition + && first != EXIT_BLOCK_PTR + && find_reg_note (BB_END (first), REG_CROSSING_JUMP, NULL_RTX)) + return false; + while (counter < n_basic_blocks) { basic_block new_target = NULL; @@ -453,6 +461,7 @@ try_forward_edges (int mode, basic_block b) may_thread |= target->flags & BB_DIRTY; if (FORWARDER_BLOCK_P (target) + && !target->succ->crossing_edge && target->succ->dest != EXIT_BLOCK_PTR) { /* Bypass trivial infinite loops. */ |