2009-01-06 Richard Sandiford <rdsandiford@googlemail.com>
+ * function.h (rtl_data): Add a dbr_scheduled_p field.
+ * reorg.c (dbr_schedule): Set it.
+ (gate_handle_delay_slots): Check it.
+ * config/mips/mips.c (mips_base_delayed_branch): Delete.
+ (mips_reorg): Check flag_delayed_branch instead of
+ mips_base_delayed_branch.
+ (mips_override_options): Don't set mips_base_delayed_branch
+ or flag_delayed_branch.
+
+2009-01-06 Richard Sandiford <rdsandiford@googlemail.com>
+
PR rtl-optimization/38426.
* ira.c (ira): Set current_function_is_leaf earlier.
bool mips_base_mips16;
/* The ambient values of other global variables. */
-static int mips_base_delayed_branch; /* flag_delayed_branch */
static int mips_base_schedule_insns; /* flag_schedule_insns */
static int mips_base_reorder_blocks_and_partition; /* flag_reorder... */
static int mips_base_move_loop_invariants; /* flag_move_loop_invariants */
mips16_lay_out_constants ();
if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE)
r10k_insert_cache_barriers ();
- if (mips_base_delayed_branch)
+ if (flag_delayed_branch)
dbr_schedule (get_insns ());
mips_reorg_process_insns ();
if (!TARGET_MIPS16
/* Save base state of options. */
mips_base_target_flags = target_flags;
- mips_base_delayed_branch = flag_delayed_branch;
mips_base_schedule_insns = flag_schedule_insns;
mips_base_reorder_blocks_and_partition = flag_reorder_blocks_and_partition;
mips_base_move_loop_invariants = flag_move_loop_invariants;
Do all CPP-sensitive stuff in non-MIPS16 mode; we'll switch to
MIPS16 mode afterwards if need be. */
mips_set_mips16_mode (false);
-
- /* We call dbr_schedule from within mips_reorg. */
- flag_delayed_branch = 0;
}
/* Swap the register information for registers I and I + 1, which
/* Nonzero if function stack realignment has been finalized, namely
stack_realign_needed flag has been set and finalized after reload. */
bool stack_realign_finalized;
+
+ /* True if dbr_schedule has already been called for this function. */
+ bool dbr_scheduled_p;
};
#define return_label (crtl->x_return_label)
}
#endif
+ crtl->dbr_scheduled_p = true;
}
#endif /* DELAY_SLOTS */
\f
gate_handle_delay_slots (void)
{
#ifdef DELAY_SLOTS
- return flag_delayed_branch;
+ return flag_delayed_branch && !crtl->dbr_scheduled_p;
#else
return 0;
#endif