This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] passes.c: Remove dead code.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: bonzini at gnu dot org
- Date: Thu, 04 Nov 2004 19:55:52 -0500 (EST)
- Subject: [patch] passes.c: Remove dead code.
Hi,
Attached is a patch to remove dead code.
We carry over the CFG from the tree optimizers, so we do not have to
rebuild the CFG. In fact, the two "if" statements shown in the patch
never trigger.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2004-11-04 Kazu Hirata <kazu@cs.umass.edu>
* passes.c (rest_of_handle_jump): Remove dead code.
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.52
diff -c -d -p -r2.52 passes.c
*** passes.c 25 Sep 2004 10:05:09 -0000 2.52
--- passes.c 4 Nov 2004 14:10:26 -0000
*************** rest_of_handle_jump (void)
*** 1291,1317 ****
timevar_push (TV_JUMP);
open_dump_file (DFI_sibling, current_function_decl);
! /* ??? 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);
! }
- /* ??? 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 ();
--- 1291,1299 ----
timevar_push (TV_JUMP);
open_dump_file (DFI_sibling, current_function_decl);
! /* The CFG should be carried over from the tree optimizers. */
! gcc_assert (basic_block_info != 0);
delete_unreachable_blocks ();
#ifdef ENABLE_CHECKING
verify_flow_info ();