+2004-07-26 Richard Sandiford <rsandifo@redhat.com>
+
+ PR rtl-optimization/16643
+ * cfglayout.h (cfg_layout_initialize): Add a flags parameter.
+ * cfglayout.c (cfg_layout_initialize): Pass it to cleanup_cfg.
+ * basic-block.h (reorder_basic_blocks): Add a flags parameter.
+ * cfglayout.c (reorder_basic_blocks): Pass it to cfg_layout_initialize.
+ (partition_hot_cold_basic_blocks): Pass 0 to cfg_layout_initialize.
+ * function.c (thread_prologue_and_epilogue_insns): Likewise.
+ * rtl.h (tracer): Add a flags parameter.
+ * tracer.c (tracer): Pass it to cfg_layout_initialise.
+ * passes.c (rest_of_handle_stack_regs): Pass 0 to reorder_basic_blocks.
+ (rest_of_handle_reorder_blocks): Update calls to tracer and
+ reorder_basic_blocks, passing CLEANUP_UPDATE_LIFE if appropriate.
+ (rest_of_handle_tracer): Pass 0 to tracer.
+ (rest_of_handle_loop2): Pass 0 to cfg_layout_initialize.
+
2004-07-25 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (movdi_internal64): Further disparage
extern bool control_flow_insn_p (rtx);
/* In bb-reorder.c */
-extern void reorder_basic_blocks (void);
+extern void reorder_basic_blocks (unsigned int);
extern void partition_hot_cold_basic_blocks (void);
/* In cfg.c */
add_reg_crossing_jump_notes ();
}
-/* Reorder basic blocks. The main entry point to this file. */
+/* Reorder basic blocks. The main entry point to this file. FLAGS is
+ the set of flags to pass to cfg_layout_initialize(). */
void
-reorder_basic_blocks (void)
+reorder_basic_blocks (unsigned int flags)
{
int n_traces;
int i;
timevar_push (TV_REORDER_BLOCKS);
- cfg_layout_initialize ();
+ cfg_layout_initialize (flags);
set_edge_can_fallthru_flag ();
mark_dfs_back_edges ();
crossing_edges = xcalloc (max_edges, sizeof (edge));
- cfg_layout_initialize ();
+ cfg_layout_initialize (0);
FOR_EACH_BB (cur_bb)
if (cur_bb->index >= 0
return new_bb;
}
\f
-/* Main entry point to this module - initialize the data structures for
- CFG layout changes. It keeps LOOPS up-to-date if not null. */
+/* Main entry point to this module - initialize the datastructures for
+ CFG layout changes. It keeps LOOPS up-to-date if not null.
+
+ FLAGS is a set of additional flags to pass to cleanup_cfg(). It should
+ include CLEANUP_UPDATE_LIFE if liveness information must be kept up
+ to date. */
void
-cfg_layout_initialize (void)
+cfg_layout_initialize (unsigned int flags)
{
basic_block bb;
record_effective_endpoints ();
- cleanup_cfg (CLEANUP_CFGLAYOUT);
+ cleanup_cfg (CLEANUP_CFGLAYOUT | flags);
}
/* Splits superblocks. */
extern rtx cfg_layout_function_footer;
-extern void cfg_layout_initialize (void);
+extern void cfg_layout_initialize (unsigned int);
extern void cfg_layout_finalize (void);
extern void insn_locators_initialize (void);
extern void reemit_insn_block_notes (void);
use return. Inserting a jump 'by hand' is extremely messy, so
we take advantage of cfg_layout_finalize using
fixup_fallthru_exit_predecessor. */
- cfg_layout_initialize ();
+ cfg_layout_initialize (0);
FOR_EACH_BB (cur_bb)
if (cur_bb->index >= 0 && cur_bb->next_bb->index >= 0)
cur_bb->rbi->next = cur_bb->next_bb;
| (flag_crossjumping ? CLEANUP_CROSSJUMP : 0))
&& (flag_reorder_blocks || flag_reorder_blocks_and_partition))
{
- reorder_basic_blocks ();
+ reorder_basic_blocks (0);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
}
}
rest_of_handle_reorder_blocks (void)
{
bool changed;
+ unsigned int liveness_flags;
+
open_dump_file (DFI_bbro, current_function_decl);
/* Last attempt to optimize CFG, as scheduling, peepholing and insn
splitting possibly introduced more crossjumping opportunities. */
- changed = cleanup_cfg (CLEANUP_EXPENSIVE
- | (!HAVE_conditional_execution
- ? CLEANUP_UPDATE_LIFE : 0));
+ liveness_flags = (!HAVE_conditional_execution ? CLEANUP_UPDATE_LIFE : 0);
+ changed = cleanup_cfg (CLEANUP_EXPENSIVE | liveness_flags);
if (flag_sched2_use_traces && flag_schedule_insns_after_reload)
- tracer ();
+ tracer (liveness_flags);
if (flag_reorder_blocks || flag_reorder_blocks_and_partition)
- reorder_basic_blocks ();
+ reorder_basic_blocks (liveness_flags);
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
- ? CLEANUP_UPDATE_LIFE : 0));
+ changed |= cleanup_cfg (CLEANUP_EXPENSIVE | liveness_flags);
/* On conditional execution targets we can not update the life cheaply, so
we deffer the updating to after both cleanups. This may lose some cases
open_dump_file (DFI_tracer, current_function_decl);
if (dump_file)
dump_flow_info (dump_file);
- tracer ();
+ tracer (0);
cleanup_cfg (CLEANUP_EXPENSIVE);
reg_scan (get_insns (), max_reg_num (), 0);
close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
dump_flow_info (dump_file);
/* Initialize structures for layout changes. */
- cfg_layout_initialize ();
+ cfg_layout_initialize (0);
loops = loop_optimizer_init (dump_file);
extern void invert_br_probabilities (rtx);
extern bool expensive_function_p (int);
/* In tracer.c */
-extern void tracer (void);
+extern void tracer (unsigned int);
/* In var-tracking.c */
extern void variable_tracking_main (void);
+2004-07-26 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcc.c-torture/compile/20040726-1.c: New test.
+
2004-07-26 Niall Douglas <s_fsfeurope2@nedprod.com>
Brian Ryner <bryner@brianryner.com>
--- /dev/null
+/* PR rtl-optimization/16643 */
+void foo (int a, int b, int c, int d, int e, int *f)
+{
+ if (a == 0)
+ if (b == 0)
+ if (c == 0)
+ if (d == 0)
+ {
+ *f = e;
+ return;
+ }
+ *f = e;
+ return;
+}
}
}
-/* Main entry point to this file. */
+/* Main entry point to this file. FLAGS is the set of flags to pass
+ to cfg_layout_initialize(). */
void
-tracer (void)
+tracer (unsigned int flags)
{
if (n_basic_blocks <= 1)
return;
timevar_push (TV_TRACER);
- cfg_layout_initialize ();
+ cfg_layout_initialize (flags);
mark_dfs_back_edges ();
if (dump_file)
dump_flow_info (dump_file);