aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index d0ab392..2453c74 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -522,7 +522,7 @@ rest_of_handle_stack_regs (tree decl, rtx insns)
{
if (cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
| (flag_crossjumping ? CLEANUP_CROSSJUMP : 0))
- && flag_reorder_blocks)
+ && (flag_reorder_blocks || flag_reorder_blocks_and_partition))
{
reorder_basic_blocks ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
@@ -718,9 +718,9 @@ rest_of_handle_reorder_blocks (tree decl, rtx insns)
if (flag_sched2_use_traces && flag_schedule_insns_after_reload)
tracer ();
- if (flag_reorder_blocks)
+ if (flag_reorder_blocks || flag_reorder_blocks_and_partition)
reorder_basic_blocks ();
- if (flag_reorder_blocks
+ if (flag_reorder_blocks || flag_reorder_blocks_and_partition
|| (flag_sched2_use_traces && flag_schedule_insns_after_reload))
changed |= cleanup_cfg (CLEANUP_EXPENSIVE
| (!HAVE_conditional_execution
@@ -1806,6 +1806,20 @@ rest_of_compilation (tree decl)
if (flag_if_conversion)
rest_of_handle_if_after_combine (decl, insns);
+ /* The optimization to partition hot/cold basic blocks into separate
+ sections of the .o file does not work well with exception handling.
+ Don't call it if there are exceptions. */
+
+ if (flag_reorder_blocks_and_partition && !flag_exceptions)
+ {
+ no_new_pseudos = 0;
+ partition_hot_cold_basic_blocks ();
+ allocate_reg_life_data ();
+ update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
+ PROP_LOG_LINKS | PROP_REG_INFO | PROP_DEATH_NOTES);
+ no_new_pseudos = 1;
+ }
+
if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
rest_of_handle_regmove (decl, insns);