diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e7dab0c3461..3f0d97ae273d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,30 @@ +2008-08-05 Paolo Bonzini + + * configure.ac: Remove --enable-checking=df from default settings. + * tree-pass.h (TODO_df_verify): New. Shift TODO_mark_first_instance. + * df-core.c (df_finish_pass) [ENABLE_CHECKING]: Schedule verification + if the parameter is true. + (df_analyze) [!ENABLE_DF_CHECKING]: Also do verification if the + DF_VERIFY_SCHEDULED flag is true. + * df.h (enum df_changeable_flags): Add DF_VERIFY_SCHEDULED. + (df_finish_pass): Adjust prototype. + * passes.c (execute_todo): Schedule verification if TODO_df_verify is + true. + + * see.c (pass_see): Add TODO_df_verify. + * loop-init.c (pass_rtl_move_loop_invariants): Add TODO_df_verify. + * global.c (rest_of_handle_global_alloc): Schedule verification + after the pass. + * local-alloc.c (rest_of_handle_local_alloc): Schedule verification + before the pass. + * function.c (pass_thread_prologue_and_epilogue): Add TODO_df_verify. + * gcse.c (rest_of_handle_gcse): Adjust call to df_finish_pass. + * loop-iv.c (iv_analysis_done): Schedule verification after the pass. + + * config/sh/sh.c (sh_output_mi_thunk): Remove dead code. + * config/ia64/ia64.c (ia64_reorg): Adjust call to df_finish_pass. + * config/bfin/bfin.c (bfin_reorg): Adjust call to df_finish_pass. + 2007-08-05 Vladimir Yanovsky Revital Eres diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 1ba019cd243d..a946ba66d481 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -4534,7 +4534,7 @@ bfin_reorg (void) reorder_var_tracking_notes (); timevar_pop (TV_VAR_TRACKING); } - df_finish_pass (); + df_finish_pass (false); } /* Handle interrupt_handler, exception_handler and nmi_handler function diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 1b73c3b5aeee..cf704935795b 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -8625,7 +8625,7 @@ ia64_reorg (void) variable_tracking_main (); timevar_pop (TV_VAR_TRACKING); } - df_finish_pass (); + df_finish_pass (false); } /* Return true if REGNO is used by the epilogue. */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a0ce6de3310f..290d3f05d3b4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -10257,22 +10257,6 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, final (insns, file, 1); final_end_function (); -#if 0 - if (optimize > 0) - { - /* Release all memory allocated by df. */ - if (rtl_df) - { - df_finish (rtl_df); - rtl_df = NULL; - } - - /* Release the bitmap obstacks. */ - bitmap_obstack_release (®_obstack); - bitmap_obstack_release (NULL); - } -#endif - reload_completed = 0; epilogue_completed = 0; } diff --git a/gcc/configure b/gcc/configure index 376a3e394c45..d7de8f0a96c2 100755 --- a/gcc/configure +++ b/gcc/configure @@ -6425,7 +6425,7 @@ for check in release $ac_checking_flags do case $check in # these set all the flags to specific states - yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ; + yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ; ac_fold_checking= ; ac_gc_checking=1 ; ac_gc_always_collect= ; ac_rtl_checking= ; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; diff --git a/gcc/configure.ac b/gcc/configure.ac index b50bba56fb11..1eecc61b486b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -359,7 +359,7 @@ for check in release $ac_checking_flags do case $check in # these set all the flags to specific states - yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ; + yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ; ac_fold_checking= ; ac_gc_checking=1 ; ac_gc_always_collect= ; ac_rtl_checking= ; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; diff --git a/gcc/df-core.c b/gcc/df-core.c index 453d61a999fe..3b4e7b3e579e 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -79,7 +79,7 @@ Here is an example of using the dataflow routines. df_dump (stderr); - df_finish_pass (); + df_finish_pass (false); DF_[ru,rd,urec,ri,chain]_ADD_PROBLEM adds a problem, defined by an instance to struct df_problem, to the set of problems solved in this @@ -633,7 +633,7 @@ df_remove_problem (struct dataflow *dflow) of the changeable_flags. */ void -df_finish_pass (void) +df_finish_pass (bool verify ATTRIBUTE_UNUSED) { int i; int removed = 0; @@ -694,6 +694,11 @@ df_finish_pass (void) df_set_clean_cfg (); #endif #endif + +#ifdef ENABLE_CHECKING + if (verify) + df->changeable_flags |= DF_VERIFY_SCHEDULED; +#endif } @@ -1100,9 +1105,10 @@ df_analyze (void) if (dump_file) fprintf (dump_file, "df_analyze called\n"); -#ifdef ENABLE_DF_CHECKING - df_verify (); -#endif +#ifndef ENABLE_DF_CHECKING + if (df->changeable_flags & DF_VERIFY_SCHEDULED) +#endif + df_verify (); for (i = 0; i < df->n_blocks; i++) bitmap_set_bit (current_all_blocks, df->postorder[i]); @@ -1509,9 +1515,11 @@ void df_verify (void) { df_scan_verify (); +#ifdef ENABLE_DF_CHECKING df_lr_verify_transfer_functions (); if (df_live) df_live_verify_transfer_functions (); +#endif } #ifdef DF_DEBUG_CFG diff --git a/gcc/df.h b/gcc/df.h index de8afc334842..7457277915d0 100644 --- a/gcc/df.h +++ b/gcc/df.h @@ -407,7 +407,9 @@ enum df_changeable_flags /* Cause df_insn_rescan df_notes_rescan and df_insn_delete, to return after marking the insn for later processing. This allows all rescans to be batched. */ - DF_DEFER_INSN_RESCAN = 32 + DF_DEFER_INSN_RESCAN = 32, + + DF_VERIFY_SCHEDULED = 64 }; /* Two of these structures are inline in df, one for the uses and one @@ -807,7 +809,7 @@ extern enum df_changeable_flags df_set_flags (enum df_changeable_flags); extern enum df_changeable_flags df_clear_flags (enum df_changeable_flags); extern void df_set_blocks (bitmap); extern void df_remove_problem (struct dataflow *); -extern void df_finish_pass (void); +extern void df_finish_pass (bool); extern void df_analyze_problem (struct dataflow *, bitmap, int *, int); extern void df_analyze (void); extern int df_get_n_blocks (enum df_flow_dir); diff --git a/gcc/function.c b/gcc/function.c index 1856a6095e15..edbef6c15a9b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5514,6 +5514,7 @@ struct tree_opt_pass pass_thread_prologue_and_epilogue = 0, /* properties_destroyed */ TODO_verify_flow, /* todo_flags_start */ TODO_dump_func | + TODO_df_verify | TODO_df_finish | TODO_ggc_collect, /* todo_flags_finish */ 'w' /* letter */ diff --git a/gcc/gcse.c b/gcc/gcse.c index 09a285997899..8b82c8e57997 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -6706,7 +6706,7 @@ rest_of_handle_gcse (void) { timevar_push (TV_CSE); tem2 = cse_main (get_insns (), max_reg_num ()); - df_finish_pass (); + df_finish_pass (false); purge_all_dead_edges (); delete_trivially_dead_insns (get_insns (), max_reg_num ()); timevar_pop (TV_CSE); diff --git a/gcc/global.c b/gcc/global.c index 57e401ac9908..c346e6ad5f2b 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -2081,7 +2081,7 @@ rest_of_handle_global_alloc (void) just rescan everything. Not that df_rescan_all_insns is not going to help here because it does not touch the artificial uses and defs. */ - df_finish_pass (); + df_finish_pass (true); if (optimize > 1) df_live_add_problem (); df_scan_alloc (NULL); diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 3a8401b91511..c42b7149145d 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -2515,6 +2515,9 @@ rest_of_handle_local_alloc (void) we are doing optimization. */ if (optimize) df_urec_add_problem (); +#ifdef ENABLE_CHECKING + df->changeable_flags |= DF_VERIFY_SCHEDULED; +#endif df_analyze (); regstat_init_n_sets_and_refs (); regstat_compute_ri (); diff --git a/gcc/loop-init.c b/gcc/loop-init.c index af62a31a9b8b..79d9056f2b36 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -251,7 +251,8 @@ struct tree_opt_pass pass_rtl_move_loop_invariants = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_df_finish | /* This is shutting down the instance in loop_invariant.c */ + TODO_df_verify | + TODO_df_finish | TODO_dump_func, /* todo_flags_finish */ 'L' /* letter */ }; diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 4f95d8ddf4c5..173cd68bbba2 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -1266,7 +1266,7 @@ iv_analysis_done (void) { clear_iv_info (); clean_slate = true; - df_finish_pass (); + df_finish_pass (true); htab_delete (bivs); free (iv_ref_table); iv_ref_table = NULL; diff --git a/gcc/passes.c b/gcc/passes.c index 51517063d8fb..8258ca234485 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1013,7 +1013,7 @@ execute_todo (unsigned int flags) /* Now that the dumping has been done, we can get rid of the optional df problems. */ if (flags & TODO_df_finish) - df_finish_pass (); + df_finish_pass ((flags & TODO_df_verify) != 0); } /* Verify invariants that should hold between passes. This is a place diff --git a/gcc/see.c b/gcc/see.c index 7d50059887b5..0aba8df71328 100644 --- a/gcc/see.c +++ b/gcc/see.c @@ -3831,6 +3831,7 @@ struct tree_opt_pass pass_see = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ + TODO_df_verify | TODO_df_finish | TODO_dump_func, /* todo_flags_finish */ 'u' /* letter */ diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index e210798e63e4..fc12a6c738eb 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -222,8 +222,11 @@ struct dump_file_info the instance before it is destroyed. */ #define TODO_df_finish (1 << 16) +/* Call df_verify at the end of the pass if checking is enabled. */ +#define TODO_df_verify (1 << 17) + /* Internally used for the first instance of a pass. */ -#define TODO_mark_first_instance (1 << 17) +#define TODO_mark_first_instance (1 << 18) #define TODO_update_ssa_any \ (TODO_update_ssa \