From 242229bbdc6beacddb4ed263c759d3ca52dae927 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 19 Jun 2004 15:33:06 +0000 Subject: CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385 --- gcc/passes.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'gcc/passes.c') diff --git a/gcc/passes.c b/gcc/passes.c index d959679..a4fb35a 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1385,8 +1385,6 @@ rest_of_compilation (void) else finalize_block_changes (); - init_flow (); - /* Dump the rtl code if we are dumping rtl. */ if (open_dump_file (DFI_rtl, current_function_decl)) close_dump_file (DFI_rtl, print_rtl, get_insns ()); @@ -1443,11 +1441,21 @@ rest_of_compilation (void) timevar_push (TV_JUMP); open_dump_file (DFI_sibling, current_function_decl); - rebuild_jump_labels (get_insns ()); - find_exception_handler_labels (); - find_basic_blocks (get_insns (), max_reg_num (), dump_file); + /* ??? We may get called either via tree_rest_of_compilation when the CFG + is already built or directly (for instance from coverage code). + The direct callers shall be updated. */ + if (!basic_block_info) + { + init_flow (); + rebuild_jump_labels (get_insns ()); + find_exception_handler_labels (); + find_basic_blocks (get_insns (), max_reg_num (), dump_file); + } delete_unreachable_blocks (); +#ifdef ENABLE_CHECKING + verify_flow_info(); +#endif /* Turn NOTE_INSN_PREDICTIONs into branch predictions. */ if (flag_guess_branch_prob) @@ -1515,10 +1523,8 @@ rest_of_compilation (void) if (flag_guess_branch_prob) expected_value_to_br_prob (); - reg_scan (get_insns (), max_reg_num (), 0); - rebuild_jump_labels (get_insns ()); - find_basic_blocks (get_insns (), max_reg_num (), dump_file); delete_trivially_dead_insns (get_insns (), max_reg_num ()); + reg_scan (get_insns(), max_reg_num (), 0); if (dump_file) dump_flow_info (dump_file); cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP -- cgit v1.1