This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Toplev.c reorganization


Hello,

> > I still like the idea of having all knowledge about passes and
> > structures on one place rather than spread around several different
> > files; I agree that passes.def stuff got out of my control (now I
> > like more an idea to just have a function for each of the passes
> > defined in passes.c, which seems more flexible and sufficient for
> > the purpose); on the other hand, I would like to retain
> > structures.def moreorless as it is.
> 
> Why don't you do a patch that just does the passes.def part, and then
> come back to the structures.def stuff?  I think that would be easier
> to review.

OK, here is the first part of reorganization; it just creates driver
function for passes (and in few cases, modifies passes to return whether
anything has changed).

Zdenek

	* passes.c: New.
	* passes.h: New.
	* Makefile.in (passes.o): New file.
	(toplev.o, gcse.o, lcm.o, profile.o, flow.o, cfgcleanup.o,
	combine.o, global.o, ra.o, recog.o, reg-stack.o, tracer.o,
	cfglayout.o, ifcvt.o, regrename.o, ssa.o): Add passes.h dependency.
	* basic-block.h (PROP_FINAL): Do not include PROP_LOG_LINKS.
	(reorder_basic_blocks): Declaration changed.
	* bb-reorder.c (reorder_basic_blocks): Return whether anything was
	changed.
	* cfgcleanup.c: Include passes.h.
	(cleanup_cfg): Use passes interface.
	* cfglayout.c: Include passes.h.
	(break_superblocks): Use passes interface.
	* combine.c: Include passes.h.
	(combine_instructions): Use passes interface.
	* except.c: Include passes.h.
	(finish_eh_generation): Return whether anything was changed,
	use passes interface.
	* except.h (finish_eh_generation): Declaration changed.
	* flags.h (flag_ssa_ccp, flag_ssa_dce, flag_rerun_cse_after_loop,
	flag_delete_null_pointer_checks, flag_if_conversion, flag_new_regalloc,
	flag_unswitch_loops): Declare.
	* flow.c: Include passes.h.
	(life_analysis, update_life_info): Use passes interface.
	(delete_dead_jumptables): Return whether anything was changed.
	* gcse.c: Include passes.h.
	(local_cprop_pass, one_cprop_pass): Use passes interface.
	* global.c: Include passes.h.
	(global_alloc): Use passes interface.
	* ifcvt.c: Include passes.h.
	(if_convert): Return whether anything was changed, use passes
	interface.
	* jump.c (copy_loop_headers): Return whether anything was changed.
	* lcm.c: Include passes.h.
	(optimize_mode_switching): Use passes interface.
	* profile.c: Include passes.h.
	(branch_prob): Use passes interface.
	* ra.c: Include passes.h.
	(reg_alloc): Use passes interface.
	* recog.c: Include passes.h.
	(split_all_insns): Return whether anything was changed.
	(peephole2_optimize): Return whether anything was changed, use
	passes interface.
	* recog.h (peephole2_optimize): Declaration changed.
	* reg-stack.c: Include passes.h.
	(reg_to_stack): Use passes interface.
	* regrename.c: Include passes.h.
	(copyprop_hardreg_forward): Return whether anything was changed, use
	passes interface.
	* rtl.h (split_all_insns, copy_loop_headers, delete_dead_jumptables,
	copyprop_hardreg_forward, if_convert, tracer): Declaration changed.
	(reg_alloc): Declare.
	* sibcall.c (optimize_sibling_and_tail_recursive_call): Modified.
	* ssa.c: Include passes.h.
	(convert_to_ssa, convert_from_ssa): Use passes interface.
	* toplev.c: Include passes.h.
	(reg_alloc): Declaration moved to rtl.h.
	(enum dump_file_index): Moved to toplev.h.
	(open_dump_file, close_dump_file): Made non-static.
	(flag_if_conversion, flag_delete_null_pointer_checks,
	flag_rerun_cse_after_loop): Made non-static.
	(rest_of_compilation): Use passes interface.
	* toplev.h (enum dump_file_index): Moved from toplev.c.
	(open_dump_file, close_dump_file): Declare.
	* tracer.c: Include passes.h.
	(tracer): Return whether anything was changed, use passes interface.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.994
diff -c -3 -p -r1.994 Makefile.in
*** Makefile.in	13 Feb 2003 17:23:48 -0000	1.994
--- Makefile.in	14 Feb 2003 22:03:40 -0000
*************** C_OBJS = c-parse.o c-lang.o c-pretty-pri
*** 766,773 ****
  
  # Language-independent object files.
  
! OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o	   \
!  cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o		   \
   cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o		   \
   cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o	   \
   debug.o df.o diagnostic.o doloop.o dominance.o		                   \
--- 766,773 ----
  
  # Language-independent object files.
  
! OBJS = passes.o alias.o bb-reorder.o bitmap.o builtins.o caller-save.o	   \
!  calls.o cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o	   \
   cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o		   \
   cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o	   \
   debug.o df.o diagnostic.o doloop.o dominance.o		                   \
*************** fold-const.o : fold-const.c $(CONFIG_H) 
*** 1424,1432 ****
  diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
     $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
     input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
  toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
     function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
!    debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
     dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
     graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
     ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
--- 1424,1436 ----
  diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
     $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
     input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
+ passes.o: passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) passes.h \
+    $(TIMEVAR_H) basic-block.h output.h $(RTL_H) except.h ssa.h flags.h \
+    $(RECOG_H) insn-config.h reload.h toplev.h loop.h function.h cfgloop.h \
+    $(REGS_H) integrate.h ggc.h
  toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
     function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
!    debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h passes.h \
     dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
     graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
     ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
*************** except.o : except.c $(CONFIG_H) $(SYSTEM
*** 1470,1476 ****
     flags.h except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
     insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
     dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
!    gt-except.h
  expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
     function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
     $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
--- 1474,1480 ----
     flags.h except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
     insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
     dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
!    gt-except.h passes.h
  expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
     function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
     $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
*************** cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) co
*** 1541,1547 ****
     except.h $(TARGET_H)
  gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     hard-reg-set.h flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) \
!    $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
  sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     function.h hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
  resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \
--- 1545,1552 ----
     except.h $(TARGET_H)
  gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     hard-reg-set.h flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) \
!    $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h \
!    gt-gcse.h passes.h
  sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     function.h hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
  resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \
*************** resource.o : resource.c $(CONFIG_H) $(RT
*** 1549,1558 ****
     $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
  lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     hard-reg-set.h flags.h real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \
!    $(BASIC_BLOCK_H) $(TM_P_H) df.h
  ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) varray.h \
     $(EXPR_H) hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
!    $(BASIC_BLOCK_H) output.h ssa.h
  ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h
  ssa-ccp.o : ssa-ccp.c $(CONFIG_H) system.h coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
--- 1554,1563 ----
     $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
  lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
     hard-reg-set.h flags.h real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \
!    $(BASIC_BLOCK_H) $(TM_P_H) df.h passes.h
  ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) varray.h \
     $(EXPR_H) hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
!    $(BASIC_BLOCK_H) output.h ssa.h passes.h
  ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h
  ssa-ccp.o : ssa-ccp.c $(CONFIG_H) system.h coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
*************** df.o : df.c $(CONFIG_H) $(SYSTEM_H) core
*** 1564,1570 ****
  conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) \
     $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
  profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
!    flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
     gcov-io.h gcov-iov.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) \
     $(TARGET_H) langhooks.h profile.h libfuncs.h gt-profile.h $(HASHTAB_H)
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
--- 1569,1575 ----
  conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) \
     $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
  profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
!    flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h passes.h \
     gcov-io.h gcov-iov.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) \
     $(TARGET_H) langhooks.h profile.h libfuncs.h gt-profile.h $(HASHTAB_H)
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
*************** unroll.o : unroll.c $(CONFIG_H) $(SYSTEM
*** 1581,1587 ****
  alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h
  flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
!    $(RECOG_H) function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
  cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
     function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h
--- 1586,1592 ----
  alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h
  flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
!    $(RECOG_H) function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H) passes.h
  cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
     function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h
*************** cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SY
*** 1595,1601 ****
     function.h except.h $(GGC_H)
  cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
!    $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H)
  cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
  cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
--- 1600,1606 ----
     function.h except.h $(GGC_H)
  cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
!    $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) passes.h
  cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
  cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
*************** dominance.o : dominance.c $(CONFIG_H) $(
*** 1612,1618 ****
     hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h
  et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h
  combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
!    function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
     $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
  regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
--- 1617,1623 ----
     hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h
  et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h
  combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
!    function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) passes.h \
     $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
  regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
*************** bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM
*** 1625,1635 ****
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
  global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     reload.h function.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h \
!    toplev.h $(TM_P_H)
  varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h
  ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h \
     $(RECOG_H) integrate.h function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
!    $(BASIC_BLOCK_H) df.h expr.h output.h toplev.h flags.h reload.h ra.h
  ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) \
     insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) df.h output.h ggc.h ra.h gt-ra-build.h reload.h
--- 1630,1640 ----
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
  global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     reload.h function.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h \
!    toplev.h $(TM_P_H) passes.h
  varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h
  ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h \
     $(RECOG_H) integrate.h function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
!    $(BASIC_BLOCK_H) df.h expr.h output.h toplev.h flags.h reload.h ra.h passes.h
  ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) \
     insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
     $(BASIC_BLOCK_H) df.h output.h ggc.h ra.h gt-ra-build.h reload.h
*************** final.o : final.c $(CONFIG_H) $(SYSTEM_H
*** 1683,1692 ****
     $(EXPR_H)
  recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \
     $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
!    $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
  reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
!    varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
  sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
  predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
--- 1688,1697 ----
     $(EXPR_H)
  recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \
     $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
!    $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H) passes.h
  reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
!    varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h passes.h
  sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
  predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
*************** bb-reorder.o : bb-reorder.c $(CONFIG_H) 
*** 1698,1715 ****
     $(TARGET_H)
  tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
!    $(PARAMS_H) profile.h
  cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h function.h \
!    cfglayout.h cfgloop.h
  timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \
     intl.h toplev.h
  regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
!    resource.h $(OBSTACK_H) flags.h $(TM_P_H)
  ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) toplev.h \
     flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
!    output.h except.h $(TM_P_H) real.h
  params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
  hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
  
--- 1703,1720 ----
     $(TARGET_H)
  tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
!    $(PARAMS_H) profile.h passes.h
  cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
     insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h function.h \
!    cfglayout.h cfgloop.h passes.h
  timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \
     intl.h toplev.h
  regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
!    resource.h $(OBSTACK_H) flags.h $(TM_P_H) passes.h
  ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) toplev.h \
     flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
!    output.h except.h $(TM_P_H) real.h passes.h
  params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
  hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
  
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.169
diff -c -3 -p -r1.169 basic-block.h
*** basic-block.h	6 Feb 2003 10:02:31 -0000	1.169
--- basic-block.h	14 Feb 2003 22:03:41 -0000
*************** enum update_life_extent
*** 475,481 ****
  #define PROP_AUTOINC		64	/* Create autoinc mem references.  */
  #define PROP_EQUAL_NOTES	128	/* Take into account REG_EQUAL notes.  */
  #define PROP_SCAN_DEAD_STORES	256	/* Scan for dead code.  */
! #define PROP_FINAL		(PROP_DEATH_NOTES | PROP_LOG_LINKS  \
  				 | PROP_REG_INFO | PROP_KILL_DEAD_CODE  \
  				 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
  				 | PROP_ALLOW_CFG_CHANGES \
--- 475,481 ----
  #define PROP_AUTOINC		64	/* Create autoinc mem references.  */
  #define PROP_EQUAL_NOTES	128	/* Take into account REG_EQUAL notes.  */
  #define PROP_SCAN_DEAD_STORES	256	/* Scan for dead code.  */
! #define PROP_FINAL		(PROP_DEATH_NOTES  \
  				 | PROP_REG_INFO | PROP_KILL_DEAD_CODE  \
  				 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
  				 | PROP_ALLOW_CFG_CHANGES \
*************** extern bool probably_never_executed_bb_p
*** 537,543 ****
  
  /* In flow.c */
  extern void init_flow                   PARAMS ((void));
! extern void reorder_basic_blocks	PARAMS ((void));
  extern void dump_bb			PARAMS ((basic_block, FILE *));
  extern void debug_bb			PARAMS ((basic_block));
  extern void debug_bb_n			PARAMS ((int));
--- 537,543 ----
  
  /* In flow.c */
  extern void init_flow                   PARAMS ((void));
! extern bool reorder_basic_blocks	PARAMS ((void));
  extern void dump_bb			PARAMS ((basic_block, FILE *));
  extern void debug_bb			PARAMS ((basic_block));
  extern void debug_bb_n			PARAMS ((int));
Index: bb-reorder.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bb-reorder.c,v
retrieving revision 1.53
diff -c -3 -p -r1.53 bb-reorder.c
*** bb-reorder.c	10 Feb 2003 19:18:42 -0000	1.53
--- bb-reorder.c	14 Feb 2003 22:03:42 -0000
*************** get_uncond_jump_length ()
*** 1053,1059 ****
  
  /* Reorder basic blocks.  The main entry point to this file.  */
  
! void
  reorder_basic_blocks ()
  {
    int n_traces;
--- 1053,1059 ----
  
  /* Reorder basic blocks.  The main entry point to this file.  */
  
! bool
  reorder_basic_blocks ()
  {
    int n_traces;
*************** reorder_basic_blocks ()
*** 1061,1070 ****
    struct trace *traces;
  
    if (n_basic_blocks <= 1)
!     return;
  
    if ((* targetm.cannot_modify_jumps_p) ())
!     return;
  
    cfg_layout_initialize (NULL);
  
--- 1061,1070 ----
    struct trace *traces;
  
    if (n_basic_blocks <= 1)
!     return false;
  
    if ((* targetm.cannot_modify_jumps_p) ())
!     return false;
  
    cfg_layout_initialize (NULL);
  
*************** reorder_basic_blocks ()
*** 1098,1101 ****
--- 1098,1103 ----
      dump_flow_info (rtl_dump_file);
  
    cfg_layout_finalize ();
+ 
+   return true;
  }
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.72
diff -c -3 -p -r1.72 cfgcleanup.c
*** cfgcleanup.c	13 Feb 2003 18:31:40 -0000	1.72
--- cfgcleanup.c	14 Feb 2003 22:03:44 -0000
*************** Software Foundation, 59 Temple Place - S
*** 47,52 ****
--- 47,53 ----
  #include "cselib.h"
  #include "tm_p.h"
  #include "target.h"
+ #include "passes.h"
  
  /* cleanup_cfg maintains following flags for each basic block.  */
  
*************** cleanup_cfg (mode)
*** 1763,1769 ****
    bool changed = false;
  
    timevar_push (TV_CLEANUP_CFG);
!   if (delete_unreachable_blocks ())
      {
        changed = true;
        /* We've possibly created trivially dead code.  Cleanup it right
--- 1764,1770 ----
    bool changed = false;
  
    timevar_push (TV_CLEANUP_CFG);
!   if (delete_unreachable_blocks_routine_driver ())
      {
        changed = true;
        /* We've possibly created trivially dead code.  Cleanup it right
*************** cleanup_cfg (mode)
*** 1771,1805 ****
        if (!(mode & (CLEANUP_NO_INSN_DEL
  		    | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
  	  && !reload_completed)
! 	delete_trivially_dead_insns (get_insns(), max_reg_num ());
      }
  
    compact_blocks ();
  
    while (try_optimize_cfg (mode))
      {
!       delete_unreachable_blocks (), changed = true;
        if (mode & CLEANUP_UPDATE_LIFE)
  	{
  	  /* Cleaning up CFG introduces more opportunities for dead code
  	     removal that in turn may introduce more opportunities for
  	     cleaning up the CFG.  */
! 	  if (!update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! 						 PROP_DEATH_NOTES
! 						 | PROP_SCAN_DEAD_CODE
! 						 | PROP_KILL_DEAD_CODE
! 						 | PROP_LOG_LINKS))
  	    break;
  	}
        else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
  	       && !reload_completed)
  	{
! 	  if (!delete_trivially_dead_insns (get_insns(), max_reg_num ()))
  	    break;
  	}
        else
  	break;
!       delete_dead_jumptables ();
      }
  
    /* Kill the data we won't maintain.  */
--- 1772,1802 ----
        if (!(mode & (CLEANUP_NO_INSN_DEL
  		    | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
  	  && !reload_completed)
! 	trivial_dce_routine_driver ();
      }
  
    compact_blocks ();
  
    while (try_optimize_cfg (mode))
      {
!       delete_unreachable_blocks_routine_driver (), changed = true;
        if (mode & CLEANUP_UPDATE_LIFE)
  	{
  	  /* Cleaning up CFG introduces more opportunities for dead code
  	     removal that in turn may introduce more opportunities for
  	     cleaning up the CFG.  */
! 	  if (!dce_routine_driver ())
  	    break;
  	}
        else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
  	       && !reload_completed)
  	{
! 	  if (!trivial_dce_routine_driver ())
  	    break;
  	}
        else
  	break;
!       delete_dead_jumptables_routine_driver ();
      }
  
    /* Kill the data we won't maintain.  */
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.26
diff -c -3 -p -r1.26 cfglayout.c
*** cfglayout.c	24 Jan 2003 20:27:02 -0000	1.26
--- cfglayout.c	14 Feb 2003 22:03:45 -0000
*************** Software Foundation, 59 Temple Place - S
*** 32,37 ****
--- 32,38 ----
  #include "obstack.h"
  #include "cfglayout.h"
  #include "cfgloop.h"
+ #include "passes.h"
  
  /* The contents of the current function definition are allocated
     in this obstack, and all are freed at the end of the function.  */
*************** break_superblocks ()
*** 1033,1039 ****
  
    if (need)
      {
!       rebuild_jump_labels (get_insns ());
        find_many_sub_basic_blocks (superblocks);
      }
  
--- 1034,1040 ----
  
    if (need)
      {
!       rebuild_jump_labels_routine_driver ();
        find_many_sub_basic_blocks (superblocks);
      }
  
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.340
diff -c -3 -p -r1.340 combine.c
*** combine.c	14 Feb 2003 07:35:44 -0000	1.340
--- combine.c	14 Feb 2003 22:04:00 -0000
*************** Software Foundation, 59 Temple Place - S
*** 92,97 ****
--- 92,98 ----
  #include "recog.h"
  #include "real.h"
  #include "toplev.h"
+ #include "passes.h"
  
  /* It is not safe to use ordinary gen_lowpart in combine.
     Use gen_lowpart_for_combine instead.  See comments there.  */
*************** combine_instructions (f, nregs)
*** 751,761 ****
    EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i,
  			     BASIC_BLOCK (i)->flags |= BB_DIRTY);
    new_direct_jump_p |= purge_all_dead_edges (0);
!   delete_noop_moves (f);
  
!   update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! 				    PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
! 				    | PROP_KILL_DEAD_CODE);
  
    /* Clean up.  */
    sbitmap_free (refresh_blocks);
--- 752,760 ----
    EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i,
  			     BASIC_BLOCK (i)->flags |= BB_DIRTY);
    new_direct_jump_p |= purge_all_dead_edges (0);
!   delete_noop_moves_driver ();
  
!   dce_routine_driver ();
  
    /* Clean up.  */
    sbitmap_free (refresh_blocks);
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.235
diff -c -3 -p -r1.235 except.c
*** except.c	17 Jan 2003 14:24:19 -0000	1.235
--- except.c	14 Feb 2003 22:04:03 -0000
*************** Software Foundation, 59 Temple Place - S
*** 74,79 ****
--- 74,81 ----
  #include "target.h"
  #include "langhooks.h"
  
+ #include "passes.h"
+ 
  /* Provide defaults for stuff that may not be defined when using
     sjlj exceptions.  */
  #ifndef EH_RETURN_STACKADJ_RTX
*************** sjlj_build_landing_pads ()
*** 2250,2261 ****
    free (lp_info);
  }
  
! void
  finish_eh_generation ()
  {
    /* Nothing to do if no regions created.  */
    if (cfun->eh->region_tree == NULL)
!     return;
  
    /* The object here is to provide find_basic_blocks with detailed
       information (via reachable_handlers) on how exception control
--- 2252,2263 ----
    free (lp_info);
  }
  
! bool
  finish_eh_generation ()
  {
    /* Nothing to do if no regions created.  */
    if (cfun->eh->region_tree == NULL)
!     return false;
  
    /* The object here is to provide find_basic_blocks with detailed
       information (via reachable_handlers) on how exception control
*************** finish_eh_generation ()
*** 2266,2272 ****
       connect many of the handlers, and then type information will not
       be effective.  Still, this is a win over previous implementations.  */
  
!   cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
  
    /* These registers are used by the landing pads.  Make sure they
       have been generated.  */
--- 2268,2274 ----
       connect many of the handlers, and then type information will not
       be effective.  Still, this is a win over previous implementations.  */
  
!   cfg_cleanup_routine_driver (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
  
    /* These registers are used by the landing pads.  Make sure they
       have been generated.  */
*************** finish_eh_generation ()
*** 2287,2295 ****
  
    /* We've totally changed the CFG.  Start over.  */
    find_exception_handler_labels ();
!   rebuild_jump_labels (get_insns ());
    find_basic_blocks (get_insns (), max_reg_num (), 0);
!   cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
  }
  
  static hashval_t
--- 2289,2299 ----
  
    /* We've totally changed the CFG.  Start over.  */
    find_exception_handler_labels ();
!   rebuild_jump_labels_routine_driver ();
    find_basic_blocks (get_insns (), max_reg_num (), 0);
!   cfg_cleanup_routine_driver (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
! 
!   return true;
  }
  
  static hashval_t
Index: except.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.h,v
retrieving revision 1.65
diff -c -3 -p -r1.65 except.h
*** except.h	25 Aug 2002 05:21:10 -0000	1.65
--- except.h	14 Feb 2003 22:04:03 -0000
*************** extern void set_nothrow_function_flags		
*** 96,102 ****
  
  /* After initial rtl generation, call back to finish generating
     exception support code.  */
! extern void finish_eh_generation		PARAMS ((void));
  
  extern void init_eh				PARAMS ((void));
  extern void init_eh_for_function		PARAMS ((void));
--- 96,102 ----
  
  /* After initial rtl generation, call back to finish generating
     exception support code.  */
! extern bool finish_eh_generation		PARAMS ((void));
  
  extern void init_eh				PARAMS ((void));
  extern void init_eh_for_function		PARAMS ((void));
Index: flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.98
diff -c -3 -p -r1.98 flags.h
*** flags.h	12 Feb 2003 21:48:57 -0000	1.98
--- flags.h	14 Feb 2003 22:04:04 -0000
*************** extern int flag_zero_initialized_in_bss;
*** 652,657 ****
--- 652,683 ----
  /* Nonzero means disable transformations observable by signaling NaNs.  */
  extern int flag_signaling_nans;
  
+ /* Enable ssa conditional constant propagation.  */
+ extern int flag_ssa_ccp;
+ 
+ /* Enable ssa aggressive dead code elimination.  */
+ extern int flag_ssa_dce;
+ 
+ /* Nonzero means to rerun cse after loop optimization.  This increases
+    compilation time about 20% and picks up a few more common expressions.  */
+ 
+ extern int flag_rerun_cse_after_loop;
+ 
+ /* Nonzero means to use global dataflow analysis to eliminate
+    useless null pointer tests.  */
+ 
+ extern int flag_delete_null_pointer_checks;
+ 
+ /* Nonzero means perform if conversion.  */
+ 
+ extern int flag_if_conversion;
+ 
+ /* If nonzero, use the graph coloring register allocator.  */
+ extern int flag_new_regalloc;
+ 
+ /* Nonzero enables loop unswitching.  */
+ extern int flag_unswitch_loops;
+ 
  extern int flag_unit_at_a_time;
  
  /* True if the given mode has a NaN representation and the treatment of
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.548
diff -c -3 -p -r1.548 flow.c
*** flow.c	31 Jan 2003 06:52:48 -0000	1.548
--- flow.c	14 Feb 2003 22:04:09 -0000
*************** Software Foundation, 59 Temple Place - S
*** 138,143 ****
--- 138,144 ----
  #include "expr.h"
  #include "ssa.h"
  #include "timevar.h"
+ #include "passes.h"
  
  #include "obstack.h"
  #include "splay-tree.h"
*************** life_analysis (f, file, flags)
*** 465,471 ****
  
    /* Always remove no-op moves.  Do this before other processing so
       that we don't have to keep re-scanning them.  */
!   delete_noop_moves (f);
  
    /* Some targets can emit simpler epilogues if they know that sp was
       not ever modified during the function.  After reload, of course,
--- 466,472 ----
  
    /* Always remove no-op moves.  Do this before other processing so
       that we don't have to keep re-scanning them.  */
!   delete_noop_moves_driver ();
  
    /* Some targets can emit simpler epilogues if they know that sp was
       not ever modified during the function.  After reload, of course,
*************** life_analysis (f, file, flags)
*** 499,505 ****
    free_basic_block_vars (1);
  
    /* Removing dead insns should've made jumptables really dead.  */
!   delete_dead_jumptables ();
  }
  
  /* A subroutine of verify_wide_reg, called through for_each_rtx.
--- 500,506 ----
    free_basic_block_vars (1);
  
    /* Removing dead insns should've made jumptables really dead.  */
!   delete_dead_jumptables_routine_driver ();
  }
  
  /* A subroutine of verify_wide_reg, called through for_each_rtx.
*************** update_life_info (blocks, extent, prop_f
*** 692,698 ****
  	     instructions deleted above, that might have been only a
  	     partial improvement (see MAX_MEM_SET_LIST_LEN usage).
  	     Further improvement may be possible.  */
! 	  cleanup_cfg (CLEANUP_EXPENSIVE);
  
  	  /* Zap the life information from the last round.  If we don't 
  	     do this, we can wind up with registers that no longer appear
--- 693,699 ----
  	     instructions deleted above, that might have been only a
  	     partial improvement (see MAX_MEM_SET_LIST_LEN usage).
  	     Further improvement may be possible.  */
! 	  cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE);
  
  	  /* Zap the life information from the last round.  If we don't 
  	     do this, we can wind up with registers that no longer appear
*************** delete_noop_moves (f)
*** 890,899 ****
     time of removing tablejump insn as they are referenced by the preceding
     insns computing the destination, so we delay deleting and garbagecollect
     them once life information is computed.  */
! void
  delete_dead_jumptables ()
  {
    rtx insn, next;
    for (insn = get_insns (); insn; insn = next)
      {
        next = NEXT_INSN (insn);
--- 891,902 ----
     time of removing tablejump insn as they are referenced by the preceding
     insns computing the destination, so we delay deleting and garbagecollect
     them once life information is computed.  */
! bool
  delete_dead_jumptables ()
  {
    rtx insn, next;
+   int changed = false;
+ 
    for (insn = get_insns (); insn; insn = next)
      {
        next = NEXT_INSN (insn);
*************** delete_dead_jumptables ()
*** 908,915 ****
--- 911,920 ----
  	  delete_insn (NEXT_INSN (insn));
  	  delete_insn (insn);
  	  next = NEXT_INSN (next);
+ 	  changed = true;
  	}
      }
+   return changed;
  }
  
  /* Determine if the stack pointer is constant over the life of the function.
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.235
diff -c -3 -p -r1.235 gcse.c
*** gcse.c	12 Feb 2003 06:14:12 -0000	1.235
--- gcse.c	14 Feb 2003 22:04:17 -0000
*************** Software Foundation, 59 Temple Place - S
*** 165,170 ****
--- 165,171 ----
  #include "ggc.h"
  #include "params.h"
  #include "cselib.h"
+ #include "passes.h"
  
  #include "obstack.h"
  
*************** local_cprop_pass (alter_jumps)
*** 4472,4478 ****
    /* Global analysis may get into infinite loops for unreachable blocks.  */
    if (changed && alter_jumps)
      {
!       delete_unreachable_blocks ();
        free_reg_set_mem ();
        alloc_reg_set_mem (max_reg_num ());
        compute_sets (get_insns ());
--- 4473,4479 ----
    /* Global analysis may get into infinite loops for unreachable blocks.  */
    if (changed && alter_jumps)
      {
!       delete_unreachable_blocks_routine_driver ();
        free_reg_set_mem ();
        alloc_reg_set_mem (max_reg_num ());
        compute_sets (get_insns ());
*************** one_cprop_pass (pass, cprop_jumps, bypas
*** 4689,4695 ****
      }
    /* Global analysis may get into infinite loops for unreachable blocks.  */
    if (changed && cprop_jumps)
!     delete_unreachable_blocks ();
  
    return changed;
  }
--- 4690,4696 ----
      }
    /* Global analysis may get into infinite loops for unreachable blocks.  */
    if (changed && cprop_jumps)
!     delete_unreachable_blocks_routine_driver ();
  
    return changed;
  }
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.90
diff -c -3 -p -r1.90 global.c
*** global.c	17 Jan 2003 14:24:24 -0000	1.90
--- global.c	14 Feb 2003 22:04:20 -0000
*************** Software Foundation, 59 Temple Place - S
*** 37,42 ****
--- 37,43 ----
  #include "reload.h"
  #include "output.h"
  #include "toplev.h"
+ #include "passes.h"
  
  /* This pass of the compiler performs global register allocation.
     It assigns hard register numbers to all the pseudo registers
*************** global_alloc (file)
*** 582,588 ****
  #endif
      {
        build_insn_chain (get_insns ());
!       retval = reload (get_insns (), 1);
      }
  
    /* Clean up.  */
--- 583,589 ----
  #endif
      {
        build_insn_chain (get_insns ());
!       reload_driver (1, &retval);
      }
  
    /* Clean up.  */
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 ifcvt.c
*** ifcvt.c	24 Jan 2003 02:59:58 -0000	1.112
--- ifcvt.c	14 Feb 2003 22:04:22 -0000
***************
*** 37,42 ****
--- 37,43 ----
  #include "output.h"
  #include "toplev.h"
  #include "tm_p.h"
+ #include "passes.h"
  
  
  #ifndef HAVE_conditional_execution
*************** dead_or_predicable (test_bb, merge_bb, o
*** 3102,3108 ****
  
  /* Main entry point for all if-conversion.  */
  
! void
  if_convert (x_life_data_ok)
       int x_life_data_ok;
  {
--- 3103,3109 ----
  
  /* Main entry point for all if-conversion.  */
  
! bool
  if_convert (x_life_data_ok)
       int x_life_data_ok;
  {
*************** if_convert (x_life_data_ok)
*** 3177,3185 ****
  	  max_regno = max_reg_num ();
  	  allocate_reg_info (max_regno, FALSE, FALSE);
  	}
!       update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! 					PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
! 					| PROP_KILL_DEAD_CODE);
      }
  
    /* Write the final stats.  */
--- 3178,3184 ----
  	  max_regno = max_reg_num ();
  	  allocate_reg_info (max_regno, FALSE, FALSE);
  	}
!       dce_routine_driver ();
      }
  
    /* Write the final stats.  */
*************** if_convert (x_life_data_ok)
*** 3199,3202 ****
--- 3198,3203 ----
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
+ 
+   return num_removed_blocks || num_updated_if_blocks;
  }
Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.216
diff -c -3 -p -r1.216 jump.c
*** jump.c	10 Jan 2003 13:44:28 -0000	1.216
--- jump.c	14 Feb 2003 22:04:24 -0000
*************** next_nonnote_insn_in_loop (insn)
*** 141,151 ****
    return insn;
  }
  
! void
  copy_loop_headers (f)
       rtx f;
  {
    rtx insn, next;
    /* Now iterate optimizing jumps until nothing changes over one pass.  */
    for (insn = f; insn; insn = next)
      {
--- 141,153 ----
    return insn;
  }
  
! bool
  copy_loop_headers (f)
       rtx f;
  {
    rtx insn, next;
+   int changed = false;
+ 
    /* Now iterate optimizing jumps until nothing changes over one pass.  */
    for (insn = f; insn; insn = next)
      {
*************** copy_loop_headers (f)
*** 166,174 ****
--- 168,179 ----
  	  if (duplicate_loop_exit_test (insn))
  	    {
  	      next = NEXT_INSN (temp);
+ 	      changed = true;
  	    }
  	}
      }
+ 
+   return changed;
  }
  
  void
Index: lcm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lcm.c,v
retrieving revision 1.52
diff -c -3 -p -r1.52 lcm.c
*** lcm.c	17 Jan 2003 03:28:08 -0000	1.52
--- lcm.c	14 Feb 2003 22:04:26 -0000
*************** Software Foundation, 59 Temple Place - S
*** 63,68 ****
--- 63,69 ----
  #include "basic-block.h"
  #include "output.h"
  #include "tm_p.h"
+ #include "passes.h"
  
  /* We want target macros for the mode switching code to be able to refer
     to instruction attribute values.  */
*************** optimize_mode_switching (file)
*** 1335,1341 ****
      commit_edge_insertions ();
  
  #ifdef NORMAL_MODE
!   cleanup_cfg (CLEANUP_NO_INSN_DEL);
  #else
    if (!need_commit && !emited)
      return 0;
--- 1336,1342 ----
      commit_edge_insertions ();
  
  #ifdef NORMAL_MODE
!   cfg_cleanup_routine_driver (CLEANUP_NO_INSN_DEL);
  #else
    if (!need_commit && !emited)
      return 0;
*************** optimize_mode_switching (file)
*** 1343,1351 ****
  
    max_regno = max_reg_num ();
    allocate_reg_info (max_regno, FALSE, FALSE);
!   update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! 				    (PROP_DEATH_NOTES | PROP_KILL_DEAD_CODE
! 				     | PROP_SCAN_DEAD_CODE));
  
    return 1;
  }
--- 1344,1350 ----
  
    max_regno = max_reg_num ();
    allocate_reg_info (max_regno, FALSE, FALSE);
!   dce_routine_driver ();
  
    return 1;
  }
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.107
diff -c -3 -p -r1.107 profile.c
*** profile.c	27 Jan 2003 23:22:15 -0000	1.107
--- profile.c	14 Feb 2003 22:04:28 -0000
*************** Software Foundation, 59 Temple Place - S
*** 70,75 ****
--- 70,76 ----
  #include "libfuncs.h"
  #include "langhooks.h"
  #include "hashtab.h"
+ #include "passes.h"
  
  /* Additional information about the edges we need.  */
  struct edge_info {
*************** branch_prob ()
*** 1227,1233 ****
    remove_fake_edges ();
    /* Re-merge split basic blocks and the mess introduced by
       insert_insn_on_edge.  */
!   cleanup_cfg (profile_arc_flag ? CLEANUP_EXPENSIVE : 0);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
  
--- 1228,1234 ----
    remove_fake_edges ();
    /* Re-merge split basic blocks and the mess introduced by
       insert_insn_on_edge.  */
!   cfg_cleanup_routine_driver (profile_arc_flag ? CLEANUP_EXPENSIVE : 0);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
  
Index: ra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 ra.c
*** ra.c	17 Jan 2003 03:28:09 -0000	1.7
--- ra.c	14 Feb 2003 22:04:29 -0000
***************
*** 39,44 ****
--- 39,45 ----
  #include "toplev.h"
  #include "flags.h"
  #include "ra.h"
+ #include "passes.h"
  
  /* This is the toplevel file of a graph coloring register allocator.
     It is able to act like a George & Appel allocator, i.e. with iterative
*************** reg_alloc ()
*** 701,707 ****
       explicitly requested.  */
    if ((debug_new_regalloc & DUMP_REGCLASS) == 0)
      rtl_dump_file = NULL;
!   regclass (get_insns (), max_reg_num (), rtl_dump_file);
    rtl_dump_file = ra_dump_file;
  
    /* We don't use those NOTEs, and as we anyway change all registers,
--- 702,708 ----
       explicitly requested.  */
    if ((debug_new_regalloc & DUMP_REGCLASS) == 0)
      rtl_dump_file = NULL;
!   regclass_driver ();
    rtl_dump_file = ra_dump_file;
  
    /* We don't use those NOTEs, and as we anyway change all registers,
*************** reg_alloc ()
*** 803,814 ****
  	  /* And new insns.  */
  	  compute_bb_for_insn ();
  	  /* Some of them might be dead.  */
! 	  delete_trivially_dead_insns (get_insns (), max_reg_num ());
  	  /* Those new pseudos need to have their REFS count set.  */
  	  reg_scan_update (get_insns (), NULL, max_regno);
  	  max_regno = max_reg_num ();
  	  /* And they need useful classes too.  */
! 	  regclass (get_insns (), max_reg_num (), rtl_dump_file);
  	  rtl_dump_file = ra_dump_file;
  
  	  /* Remember the number of defs and uses, so we can distinguish
--- 804,815 ----
  	  /* And new insns.  */
  	  compute_bb_for_insn ();
  	  /* Some of them might be dead.  */
! 	  trivial_dce_routine_driver ();
  	  /* Those new pseudos need to have their REFS count set.  */
  	  reg_scan_update (get_insns (), NULL, max_regno);
  	  max_regno = max_reg_num ();
  	  /* And they need useful classes too.  */
! 	  regclass_driver ();
  	  rtl_dump_file = ra_dump_file;
  
  	  /* Remember the number of defs and uses, so we can distinguish
*************** reg_alloc ()
*** 858,866 ****
    /* Cleanup the flow graph.  */
    if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
      rtl_dump_file = NULL;
!   life_analysis (get_insns (), rtl_dump_file,
! 		 PROP_DEATH_NOTES | PROP_LOG_LINKS  | PROP_REG_INFO);
!   cleanup_cfg (CLEANUP_EXPENSIVE);
    recompute_reg_usage (get_insns (), TRUE);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
--- 859,866 ----
    /* Cleanup the flow graph.  */
    if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
      rtl_dump_file = NULL;
!   life_analysis_driver (PROP_DEATH_NOTES | PROP_LOG_LINKS  | PROP_REG_INFO);
!   cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE);
    recompute_reg_usage (get_insns (), TRUE);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
*************** reg_alloc ()
*** 893,899 ****
    /* And possibly initialize it.  */
    allocate_initial_values (reg_equiv_memory_loc);
    /* And one last regclass pass just before reload.  */
!   regclass (get_insns (), max_reg_num (), rtl_dump_file);
  }
  
  /*
--- 893,899 ----
    /* And possibly initialize it.  */
    allocate_initial_values (reg_equiv_memory_loc);
    /* And one last regclass pass just before reload.  */
!   regclass_driver ();
  }
  
  /*
Index: recog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.c,v
retrieving revision 1.174
diff -c -3 -p -r1.174 recog.c
*** recog.c	31 Jan 2003 23:34:13 -0000	1.174
--- recog.c	14 Feb 2003 22:04:39 -0000
*************** Software Foundation, 59 Temple Place - S
*** 39,44 ****
--- 39,45 ----
  #include "basic-block.h"
  #include "output.h"
  #include "reload.h"
+ #include "passes.h"
  
  #ifndef STACK_PUSH_CODE
  #ifdef STACK_GROWS_DOWNWARD
*************** split_insn (insn)
*** 2835,2841 ****
  }
  /* Split all insns in the function.  If UPD_LIFE, update life info after.  */
  
! void
  split_all_insns (upd_life)
       int upd_life;
  {
--- 2836,2842 ----
  }
  /* Split all insns in the function.  If UPD_LIFE, update life info after.  */
  
! bool
  split_all_insns (upd_life)
       int upd_life;
  {
*************** split_all_insns (upd_life)
*** 2891,2896 ****
--- 2892,2899 ----
  #endif
  
    sbitmap_free (blocks);
+ 
+   return changed;
  }
  
  /* Same as split_all_insns, but do not expect CFG to be available.
*************** peep2_find_free_register (from, to, clas
*** 3105,3111 ****
  
  /* Perform the peephole2 optimization pass.  */
  
! void
  peephole2_optimize (dump_file)
       FILE *dump_file ATTRIBUTE_UNUSED;
  {
--- 3108,3114 ----
  
  /* Perform the peephole2 optimization pass.  */
  
! bool
  peephole2_optimize (dump_file)
       FILE *dump_file ATTRIBUTE_UNUSED;
  {
*************** peephole2_optimize (dump_file)
*** 3116,3123 ****
    basic_block bb;
  #ifdef HAVE_conditional_execution
    sbitmap blocks;
-   bool changed;
  #endif
    bool do_cleanup_cfg = false;
    bool do_rebuild_jump_labels = false;
  
--- 3119,3126 ----
    basic_block bb;
  #ifdef HAVE_conditional_execution
    sbitmap blocks;
  #endif
+   bool changed;
    bool do_cleanup_cfg = false;
    bool do_rebuild_jump_labels = false;
  
*************** peephole2_optimize (dump_file)
*** 3126,3135 ****
      peep2_insn_data[i].live_before = INITIALIZE_REG_SET (rs_heads[i]);
    live = INITIALIZE_REG_SET (rs_heads[i]);
  
  #ifdef HAVE_conditional_execution
    blocks = sbitmap_alloc (last_basic_block);
    sbitmap_zero (blocks);
-   changed = false;
  #else
    count_or_remove_death_notes (NULL, 1);
  #endif
--- 3129,3138 ----
      peep2_insn_data[i].live_before = INITIALIZE_REG_SET (rs_heads[i]);
    live = INITIALIZE_REG_SET (rs_heads[i]);
  
+   changed = false;
  #ifdef HAVE_conditional_execution
    blocks = sbitmap_alloc (last_basic_block);
    sbitmap_zero (blocks);
  #else
    count_or_remove_death_notes (NULL, 1);
  #endif
*************** peephole2_optimize (dump_file)
*** 3292,3299 ****
  			        do_cleanup_cfg |= purge_dead_edges (nfte->dest);
  #ifdef HAVE_conditional_execution
  				SET_BIT (blocks, nfte->dest->index);
- 				changed = true;
  #endif
  				bb = nfte->src;
  				eh_edge = nehe;
  			      }
--- 3295,3302 ----
  			        do_cleanup_cfg |= purge_dead_edges (nfte->dest);
  #ifdef HAVE_conditional_execution
  				SET_BIT (blocks, nfte->dest->index);
  #endif
+ 				changed = true;
  				bb = nfte->src;
  				eh_edge = nehe;
  			      }
*************** peephole2_optimize (dump_file)
*** 3304,3309 ****
--- 3307,3313 ----
  		      do_cleanup_cfg |= purge_dead_edges (bb);
  		    }
  
+ 		  changed = true;
  #ifdef HAVE_conditional_execution
  		  /* With conditional execution, we cannot back up the
  		     live information so easily, since the conditional
*************** peephole2_optimize (dump_file)
*** 3311,3317 ****
  		     So record that we've made a modification to this
  		     block and update life information at the end.  */
  		  SET_BIT (blocks, bb->index);
- 		  changed = true;
  
  		  for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
  		    peep2_insn_data[i].insn = NULL_RTX;
--- 3315,3320 ----
*************** peephole2_optimize (dump_file)
*** 3368,3381 ****
    FREE_REG_SET (live);
  
    if (do_rebuild_jump_labels)
!     rebuild_jump_labels (get_insns ());
  
    /* If we eliminated EH edges, we may be able to merge blocks.  Further,
       we've changed global life since exception handlers are no longer
       reachable.  */
    if (do_cleanup_cfg)
      {
!       cleanup_cfg (0);
        update_life_info (0, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
      }
  #ifdef HAVE_conditional_execution
--- 3371,3384 ----
    FREE_REG_SET (live);
  
    if (do_rebuild_jump_labels)
!     rebuild_jump_labels_routine_driver ();
  
    /* If we eliminated EH edges, we may be able to merge blocks.  Further,
       we've changed global life since exception handlers are no longer
       reachable.  */
    if (do_cleanup_cfg)
      {
!       cfg_cleanup_routine_driver (0);
        update_life_info (0, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
      }
  #ifdef HAVE_conditional_execution
*************** peephole2_optimize (dump_file)
*** 3386,3391 ****
--- 3389,3395 ----
      }
    sbitmap_free (blocks);
  #endif
+   return changed;
  }
  #endif /* HAVE_peephole2 */
  
Index: recog.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.h,v
retrieving revision 1.43
diff -c -3 -p -r1.43 recog.h
*** recog.h	23 Jul 2002 12:08:10 -0000	1.43
--- recog.h	14 Feb 2003 22:04:39 -0000
*************** extern rtx peep2_find_free_register	PARA
*** 136,142 ****
  						 enum machine_mode,
  						 HARD_REG_SET *));
  #endif
! extern void peephole2_optimize		PARAMS ((FILE *));
  extern rtx peephole2_insns		PARAMS ((rtx, rtx, int *));
  
  extern int store_data_bypass_p		PARAMS ((rtx, rtx));
--- 136,142 ----
  						 enum machine_mode,
  						 HARD_REG_SET *));
  #endif
! extern bool peephole2_optimize		PARAMS ((FILE *));
  extern rtx peephole2_insns		PARAMS ((rtx, rtx, int *));
  
  extern int store_data_bypass_p		PARAMS ((rtx, rtx));
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-stack.c,v
retrieving revision 1.121
diff -c -3 -p -r1.121 reg-stack.c
*** reg-stack.c	13 Feb 2003 03:09:44 -0000	1.121
--- reg-stack.c	14 Feb 2003 22:04:39 -0000
***************
*** 170,175 ****
--- 170,176 ----
  #include "varray.h"
  #include "reload.h"
  #include "ggc.h"
+ #include "passes.h"
  
  /* We use this array to cache info about insns, because otherwise we
     spend too much time in stack_regs_mentioned_p.
*************** reg_to_stack (first, file)
*** 429,435 ****
    stack_regs_mentioned_data = 0;
  
    if (!optimize)
!     split_all_insns (0);
  
    /* See if there is something to do.  Flow analysis is quite
       expensive so we might save some compilation time.  */
--- 430,436 ----
    stack_regs_mentioned_data = 0;
  
    if (!optimize)
!     split_insns_driver (0);
  
    /* See if there is something to do.  Flow analysis is quite
       expensive so we might save some compilation time.  */
*************** reg_to_stack (first, file)
*** 444,450 ****
    if (!optimize)
      {
        count_or_remove_death_notes (NULL, 1);
!       life_analysis (first, file, PROP_DEATH_NOTES);
      }
    mark_dfs_back_edges ();
  
--- 445,451 ----
    if (!optimize)
      {
        count_or_remove_death_notes (NULL, 1);
!       life_analysis_driver (PROP_DEATH_NOTES);
      }
    mark_dfs_back_edges ();
  
Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.65
diff -c -3 -p -r1.65 regrename.c
*** regrename.c	7 Feb 2003 01:20:04 -0000	1.65
--- regrename.c	14 Feb 2003 22:04:39 -0000
***************
*** 37,42 ****
--- 37,43 ----
  #include "flags.h"
  #include "toplev.h"
  #include "obstack.h"
+ #include "passes.h"
  
  #ifndef REG_MODE_OK_FOR_BASE_P
  #define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
*************** copyprop_hardreg_forward_1 (bb, vd)
*** 1780,1786 ****
  
  /* Main entry point for the forward copy propagation optimization.  */
  
! void
  copyprop_hardreg_forward ()
  {
    struct value_data *all_vd;
--- 1781,1787 ----
  
  /* Main entry point for the forward copy propagation optimization.  */
  
! bool
  copyprop_hardreg_forward ()
  {
    struct value_data *all_vd;
*************** copyprop_hardreg_forward ()
*** 1820,1826 ****
        /* ??? Irritatingly, delete_noop_moves does not take a set of blocks
  	 to scan, so we have to do a life update with no initial set of
  	 blocks Just In Case.  */
!       delete_noop_moves (get_insns ());
        update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
  			PROP_DEATH_NOTES
  			| PROP_SCAN_DEAD_CODE
--- 1821,1827 ----
        /* ??? Irritatingly, delete_noop_moves does not take a set of blocks
  	 to scan, so we have to do a life update with no initial set of
  	 blocks Just In Case.  */
!       delete_noop_moves_driver ();
        update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
  			PROP_DEATH_NOTES
  			| PROP_SCAN_DEAD_CODE
*************** copyprop_hardreg_forward ()
*** 1828,1833 ****
--- 1829,1836 ----
      }
  
    free (all_vd);
+ 
+   return need_refresh;
  }
  
  /* Dump the value chain data to stderr.  */
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.383
diff -c -3 -p -r1.383 rtl.h
*** rtl.h	5 Feb 2003 00:56:40 -0000	1.383
--- rtl.h	14 Feb 2003 22:04:41 -0000
*************** extern enum reg_class reg_alternate_clas
*** 1705,1711 ****
  
  extern rtx get_first_nonparm_insn	PARAMS ((void));
  
! extern void split_all_insns		PARAMS ((int));
  extern void split_all_insns_noflow	PARAMS ((void));
  
  #define MAX_SAVED_CONST_INT 64
--- 1705,1711 ----
  
  extern rtx get_first_nonparm_insn	PARAMS ((void));
  
! extern bool split_all_insns		PARAMS ((int));
  extern void split_all_insns_noflow	PARAMS ((void));
  
  #define MAX_SAVED_CONST_INT 64
*************** extern void delete_for_peephole		PARAMS 
*** 1979,1985 ****
  extern int condjump_in_parallel_p	PARAMS ((rtx));
  extern void never_reached_warning	PARAMS ((rtx, rtx));
  extern void purge_line_number_notes	PARAMS ((rtx));
! extern void copy_loop_headers		PARAMS ((rtx));
  
  /* In emit-rtl.c.  */
  extern int max_reg_num				PARAMS ((void));
--- 1979,1985 ----
  extern int condjump_in_parallel_p	PARAMS ((rtx));
  extern void never_reached_warning	PARAMS ((rtx, rtx));
  extern void purge_line_number_notes	PARAMS ((rtx));
! extern bool copy_loop_headers		PARAMS ((rtx));
  
  /* In emit-rtl.c.  */
  extern int max_reg_num				PARAMS ((void));
*************** extern void move_by_pieces		PARAMS ((rtx
*** 2090,2096 ****
  /* In flow.c */
  extern void recompute_reg_usage			PARAMS ((rtx, int));
  extern int initialize_uninitialized_subregs	PARAMS ((void));
! extern void delete_dead_jumptables		PARAMS ((void));
  #ifdef BUFSIZ
  extern void print_rtl_with_bb			PARAMS ((FILE *, rtx));
  extern void dump_flow_info			PARAMS ((FILE *));
--- 2090,2096 ----
  /* In flow.c */
  extern void recompute_reg_usage			PARAMS ((rtx, int));
  extern int initialize_uninitialized_subregs	PARAMS ((void));
! extern bool delete_dead_jumptables		PARAMS ((void));
  #ifdef BUFSIZ
  extern void print_rtl_with_bb			PARAMS ((FILE *, rtx));
  extern void dump_flow_info			PARAMS ((FILE *));
*************** extern void retry_global_alloc		PARAMS (
*** 2122,2127 ****
--- 2122,2130 ----
  #endif
  extern void build_insn_chain		PARAMS ((rtx));
  
+ /* In ra.c.  */
+ extern void reg_alloc			PARAMS ((void));
+ 
  /* In regclass.c */
  extern int reg_classes_intersect_p	PARAMS ((enum reg_class, enum reg_class));
  extern int reg_class_subset_p		PARAMS ((enum reg_class, enum reg_class));
*************** extern GTY(()) rtx stack_limit_rtx;
*** 2294,2309 ****
  
  /* In regrename.c */
  extern void regrename_optimize		PARAMS ((void));
! extern void copyprop_hardreg_forward	PARAMS ((void));
  
  /* In ifcvt.c */
! extern void if_convert			PARAMS ((int));
  
  /* In predict.c */
  extern void invert_br_probabilities	PARAMS ((rtx));
  extern bool expensive_function_p	PARAMS ((int));
  /* In tracer.c */
! extern void tracer			PARAMS ((void));
  
  /* In calls.c */
  
--- 2297,2312 ----
  
  /* In regrename.c */
  extern void regrename_optimize		PARAMS ((void));
! extern bool copyprop_hardreg_forward	PARAMS ((void));
  
  /* In ifcvt.c */
! extern bool if_convert			PARAMS ((int));
  
  /* In predict.c */
  extern void invert_br_probabilities	PARAMS ((rtx));
  extern bool expensive_function_p	PARAMS ((int));
  /* In tracer.c */
! extern bool tracer			PARAMS ((void));
  
  /* In calls.c */
  
Index: sibcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sibcall.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 sibcall.c
*** sibcall.c	24 Dec 2002 08:30:31 -0000	1.43
--- sibcall.c	14 Feb 2003 22:04:42 -0000
*************** optimize_sibling_and_tail_recursive_call
*** 582,589 ****
  
    insns = get_insns ();
  
-   cleanup_cfg (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP);
- 
    /* If there are no basic blocks, then there is nothing to do.  */
    if (n_basic_blocks == 0)
      return;
--- 582,587 ----
Index: ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ssa.c,v
retrieving revision 1.58
diff -c -3 -p -r1.58 ssa.c
*** ssa.c	24 Dec 2002 08:30:31 -0000	1.58
--- ssa.c	14 Feb 2003 22:04:45 -0000
*************** Software Foundation, 59 Temple Place - S
*** 50,55 ****
--- 50,56 ----
  #include "basic-block.h"
  #include "output.h"
  #include "ssa.h"
+ #include "passes.h"
  
  /* TODO:
  
*************** convert_to_ssa ()
*** 1180,1186 ****
  
    /* Need global_live_at_{start,end} up to date.  Do not remove any
       dead code.  We'll let the SSA optimizers do that.  */
!   life_analysis (get_insns (), NULL, 0);
  
    idom = calculate_dominance_info (CDI_DOMINATORS);
  
--- 1181,1187 ----
  
    /* Need global_live_at_{start,end} up to date.  Do not remove any
       dead code.  We'll let the SSA optimizers do that.  */
!   life_analysis_driver (0);
  
    idom = calculate_dominance_info (CDI_DOMINATORS);
  
*************** convert_from_ssa ()
*** 2181,2187 ****
       stores.  So do not take the time to perform dead code elimination.
  
       Register coalescing needs death notes, so generate them.  */
!   life_analysis (insns, NULL, PROP_DEATH_NOTES);
  
    /* Figure out which regs in copies and phi nodes don't conflict and
       therefore can be coalesced.  */
--- 2182,2188 ----
       stores.  So do not take the time to perform dead code elimination.
  
       Register coalescing needs death notes, so generate them.  */
!   life_analysis_driver (PROP_DEATH_NOTES);
  
    /* Figure out which regs in copies and phi nodes don't conflict and
       therefore can be coalesced.  */
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.709
diff -c -3 -p -r1.709 toplev.c
*** toplev.c	12 Feb 2003 21:48:57 -0000	1.709
--- toplev.c	14 Feb 2003 22:04:51 -0000
*************** Software Foundation, 59 Temple Place - S
*** 75,80 ****
--- 75,81 ----
  #include "cfglayout.h"
  #include "cfgloop.h"
  #include "hosthooks.h"
+ #include "passes.h"
  
  #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
  #include "dwarf2out.h"
*************** Software Foundation, 59 Temple Place - S
*** 99,106 ****
  extern int size_directive_output;
  extern tree last_assemble_variable_decl;
  
- extern void reg_alloc PARAMS ((void));
- 
  static void general_init PARAMS ((char *));
  static void parse_options_and_default_flags PARAMS ((int, char **));
  static void do_compile PARAMS ((void));
--- 100,105 ----
*************** struct dump_file_info
*** 218,269 ****
    char initialized;
  };
  
- /* Enumerate the extant dump files.  */
- 
- enum dump_file_index
- {
-   DFI_rtl,
-   DFI_sibling,
-   DFI_eh,
-   DFI_jump,
-   DFI_ssa,
-   DFI_ssa_ccp,
-   DFI_ssa_dce,
-   DFI_ussa,
-   DFI_null,
-   DFI_cse,
-   DFI_addressof,
-   DFI_gcse,
-   DFI_loop,
-   DFI_bypass,
-   DFI_cfg,
-   DFI_bp,
-   DFI_ce1,
-   DFI_tracer,
-   DFI_loop2,
-   DFI_cse2,
-   DFI_life,
-   DFI_combine,
-   DFI_ce2,
-   DFI_regmove,
-   DFI_sched,
-   DFI_lreg,
-   DFI_greg,
-   DFI_postreload,
-   DFI_flow2,
-   DFI_peephole2,
-   DFI_rnreg,
-   DFI_ce3,
-   DFI_sched2,
-   DFI_stack,
-   DFI_bbro,
-   DFI_mach,
-   DFI_dbr,
-   DFI_MAX
- };
- 
  /* Describes all the dump files.  Should be kept in order of the
!    pass and in sync with dump_file_index above.
  
     Remaining -d letters:
  
--- 217,224 ----
    char initialized;
  };
  
  /* Describes all the dump files.  Should be kept in order of the
!    pass and in sync with dump_file_index in toplev.h.
  
     Remaining -d letters:
  
*************** static struct dump_file_info dump_file[D
*** 312,321 ****
    { "dbr",	'd', 0, 0, 0 },
  };
  
- static int open_dump_file PARAMS ((enum dump_file_index, tree));
- static void close_dump_file PARAMS ((enum dump_file_index,
- 				     void (*) (FILE *, rtx), rtx));
- 
  /* Other flags saying which kinds of debugging dump have been requested.  */
  
  int rtl_dump_and_exit;
--- 267,272 ----
*************** static int flag_crossjumping;
*** 627,633 ****
  
  /* Nonzero means perform if conversion.  */
  
! static int flag_if_conversion;
  
  /* Nonzero means perform if conversion after reload.  */
  
--- 578,584 ----
  
  /* Nonzero means perform if conversion.  */
  
! int flag_if_conversion;
  
  /* Nonzero means perform if conversion after reload.  */
  
*************** static int flag_if_conversion2;
*** 636,642 ****
  /* Nonzero means to use global dataflow analysis to eliminate
     useless null pointer tests.  */
  
! static int flag_delete_null_pointer_checks;
  
  /* Nonzero means perform global CSE.  */
  
--- 587,593 ----
  /* Nonzero means to use global dataflow analysis to eliminate
     useless null pointer tests.  */
  
! int flag_delete_null_pointer_checks;
  
  /* Nonzero means perform global CSE.  */
  
*************** int flag_gcse_sm = 1;
*** 657,663 ****
  /* Nonzero means to rerun cse after loop optimization.  This increases
     compilation time about 20% and picks up a few more common expressions.  */
  
! static int flag_rerun_cse_after_loop;
  
  /* Nonzero means to run loop optimizations twice.  */
  
--- 608,614 ----
  /* Nonzero means to rerun cse after loop optimization.  This increases
     compilation time about 20% and picks up a few more common expressions.  */
  
! int flag_rerun_cse_after_loop;
  
  /* Nonzero means to run loop optimizations twice.  */
  
*************** output_file_directive (asm_file, input_n
*** 1823,1829 ****
  
  /* Routine to open a dump file.  Return true if the dump file is enabled.  */
  
! static int
  open_dump_file (index, decl)
       enum dump_file_index index;
       tree decl;
--- 1774,1780 ----
  
  /* Routine to open a dump file.  Return true if the dump file is enabled.  */
  
! int
  open_dump_file (index, decl)
       enum dump_file_index index;
       tree decl;
*************** open_dump_file (index, decl)
*** 1881,1887 ****
  
  /* Routine to close a dump file.  */
  
! static void
  close_dump_file (index, func, insns)
       enum dump_file_index index;
       void (*func) PARAMS ((FILE *, rtx));
--- 1832,1838 ----
  
  /* Routine to close a dump file.  */
  
! void
  close_dump_file (index, func, insns)
       enum dump_file_index index;
       void (*func) PARAMS ((FILE *, rtx));
*************** void
*** 2399,2408 ****
  rest_of_compilation (decl)
       tree decl;
  {
-   rtx insns;
-   int tem;
    int failure = 0;
-   int rebuild_label_notes_after_reload;
  
    timevar_push (TV_REST_OF_COMPILATION);
  
--- 2350,2356 ----
*************** rest_of_compilation (decl)
*** 2481,2495 ****
  	    inlinable = DECL_INLINE (decl) = 1;
  	}
  
-       insns = get_insns ();
- 
        /* Dump the rtl code if we are dumping rtl.  */
  
        if (open_dump_file (DFI_rtl, decl))
  	{
  	  if (DECL_SAVED_INSNS (decl))
  	    fprintf (rtl_dump_file, ";; (integrable)\n\n");
! 	  close_dump_file (DFI_rtl, print_rtl, insns);
  	}
  
        /* Convert from NOTE_INSN_EH_REGION style notes, and do other
--- 2429,2441 ----
  	    inlinable = DECL_INLINE (decl) = 1;
  	}
  
        /* Dump the rtl code if we are dumping rtl.  */
  
        if (open_dump_file (DFI_rtl, decl))
  	{
  	  if (DECL_SAVED_INSNS (decl))
  	    fprintf (rtl_dump_file, ";; (integrable)\n\n");
! 	  close_dump_file (DFI_rtl, print_rtl, get_insns ());
  	}
  
        /* Convert from NOTE_INSN_EH_REGION style notes, and do other
*************** rest_of_compilation (decl)
*** 2531,2540 ****
  	      int saved_optimize = optimize;
  
  	      optimize = 0;
! 	      rebuild_jump_labels (insns);
  	      find_exception_handler_labels ();
! 	      find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
! 	      cleanup_cfg (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP);
  	      optimize = saved_optimize;
  
  	      /* CFG is no longer maintained up-to-date.  */
--- 2477,2486 ----
  	      int saved_optimize = optimize;
  
  	      optimize = 0;
! 	      rebuild_jump_labels_routine_driver ();
  	      find_exception_handler_labels ();
! 	      find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
! 	      cfg_cleanup_routine_driver (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP);
  	      optimize = saved_optimize;
  
  	      /* CFG is no longer maintained up-to-date.  */
*************** rest_of_compilation (decl)
*** 2610,2651 ****
  
    timevar_push (TV_JUMP);
    open_dump_file (DFI_sibling, decl);
!   insns = get_insns ();
!   rebuild_jump_labels (insns);
    find_exception_handler_labels ();
!   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
  
!   delete_unreachable_blocks ();
  
    /* Turn NOTE_INSN_PREDICTIONs into branch predictions.  */
    timevar_push (TV_BRANCH_PROB);
!   note_prediction_to_br_prob ();
    timevar_pop (TV_BRANCH_PROB);
  
    /* We may have potential sibling or tail recursion sites.  Select one
       (of possibly multiple) methods of performing the call.  */
    if (flag_optimize_sibling_calls)
!     {
!       rtx insn;
!       optimize_sibling_and_tail_recursive_calls ();
  
-       /* Recompute the CFG as sibling optimization clobbers it randomly.  */
-       free_bb_for_insn ();
-       find_exception_handler_labels ();
-       rebuild_jump_labels (insns);
-       find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- 
-       /* There is pass ordering problem - we must lower NOTE_INSN_PREDICTION
-          notes before simplifying cfg and we must do lowering after sibcall
-          that unhides parts of RTL chain and cleans up the CFG.
- 
-          Until sibcall is replaced by tree-level optimizer, lets just
-          sweep away the NOTE_INSN_PREDICTION notes that leaked out.  */
-       for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- 	if (GET_CODE (insn) == NOTE
- 	    && NOTE_LINE_NUMBER (insn) == NOTE_INSN_PREDICTION)
- 	  delete_insn (insn);
-     }
    close_dump_file (DFI_sibling, print_rtl, get_insns ());
    timevar_pop (TV_JUMP);
  
--- 2556,2577 ----
  
    timevar_push (TV_JUMP);
    open_dump_file (DFI_sibling, decl);
!   rebuild_jump_labels_routine_driver ();
    find_exception_handler_labels ();
!   find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
  
!   delete_unreachable_blocks_routine_driver ();
  
    /* Turn NOTE_INSN_PREDICTIONs into branch predictions.  */
    timevar_push (TV_BRANCH_PROB);
!   lower_prediction_notes_driver ();
    timevar_pop (TV_BRANCH_PROB);
  
    /* We may have potential sibling or tail recursion sites.  Select one
       (of possibly multiple) methods of performing the call.  */
    if (flag_optimize_sibling_calls)
!     tail_recursion_optimalization_driver ();
  
    close_dump_file (DFI_sibling, print_rtl, get_insns ());
    timevar_pop (TV_JUMP);
  
*************** rest_of_compilation (decl)
*** 2656,2662 ****
        timevar_push (TV_JUMP);
        open_dump_file (DFI_eh, decl);
  
!       finish_eh_generation ();
  
        close_dump_file (DFI_eh, print_rtl, get_insns ());
        timevar_pop (TV_JUMP);
--- 2582,2588 ----
        timevar_push (TV_JUMP);
        open_dump_file (DFI_eh, decl);
  
!       finish_eh_generation_driver ();
  
        close_dump_file (DFI_eh, print_rtl, get_insns ());
        timevar_pop (TV_JUMP);
*************** rest_of_compilation (decl)
*** 2675,2684 ****
      FINALIZE_PIC;
  #endif
  
-   insns = get_insns ();
- 
    /* Copy any shared structure that should not be shared.  */
!   unshare_all_rtl (current_function_decl, insns);
  
  #ifdef SETJMP_VIA_SAVE_AREA
    /* This must be performed before virtual register instantiation.
--- 2601,2608 ----
      FINALIZE_PIC;
  #endif
  
    /* Copy any shared structure that should not be shared.  */
!   unshare_all_rtl (current_function_decl, get_insns ());
  
  #ifdef SETJMP_VIA_SAVE_AREA
    /* This must be performed before virtual register instantiation.
*************** rest_of_compilation (decl)
*** 2686,2696 ****
       at the RTL up to this point must understand that REG_SAVE_AREA
       is just like a use of the REG contained inside.  */
    if (current_function_calls_alloca)
!     optimize_save_area_alloca (insns);
  #endif
  
    /* Instantiate all virtual registers.  */
!   instantiate_virtual_regs (current_function_decl, insns);
  
    open_dump_file (DFI_jump, decl);
  
--- 2610,2620 ----
       at the RTL up to this point must understand that REG_SAVE_AREA
       is just like a use of the REG contained inside.  */
    if (current_function_calls_alloca)
!     optimize_save_area_alloca_driver ();
  #endif
  
    /* Instantiate all virtual registers.  */
!   instantiate_virtual_regs (current_function_decl, get_insns ());
  
    open_dump_file (DFI_jump, decl);
  
*************** rest_of_compilation (decl)
*** 2701,2724 ****
    timevar_push (TV_JUMP);
    /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB.  Do this
       before jump optimization switches branch directions.  */
!   expected_value_to_br_prob ();
  
!   reg_scan (insns, max_reg_num (), 0);
!   rebuild_jump_labels (insns);
!   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
!   cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP
! 	       | (flag_thread_jumps ? CLEANUP_THREADING : 0));
  
    /* CFG is no longer maintained up-to-date.  */
    free_bb_for_insn ();
!   copy_loop_headers (insns);
!   purge_line_number_notes (insns);
!   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
  
    timevar_pop (TV_JUMP);
!   close_dump_file (DFI_jump, print_rtl, insns);
  
    /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
    if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
--- 2625,2649 ----
    timevar_push (TV_JUMP);
    /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB.  Do this
       before jump optimization switches branch directions.  */
!   lower_expected_value_notes_driver ();
  
!   reg_scan (get_insns (), max_reg_num (), 0);
!   rebuild_jump_labels_routine_driver ();
!   find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
!   cfg_cleanup_routine_driver ((optimize ? CLEANUP_EXPENSIVE : 0)
! 			      | CLEANUP_PRE_LOOP
! 			      | (flag_thread_jumps ? CLEANUP_THREADING : 0));
  
    /* CFG is no longer maintained up-to-date.  */
    free_bb_for_insn ();
!   copy_loop_headers_driver ();
!   purge_line_number_notes (get_insns ());
!   find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
  
    timevar_pop (TV_JUMP);
!   close_dump_file (DFI_jump, print_rtl, get_insns ());
  
    /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
    if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
*************** rest_of_compilation (decl)
*** 2731,2799 ****
       stuff at this time.  */
    if (optimize > 0 && flag_ssa)
      {
!       /* Convert to SSA form.  */
! 
!       timevar_push (TV_TO_SSA);
!       open_dump_file (DFI_ssa, decl);
! 
!       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
!       convert_to_ssa ();
! 
!       close_dump_file (DFI_ssa, print_rtl_with_bb, insns);
!       timevar_pop (TV_TO_SSA);
! 
!       /* Perform sparse conditional constant propagation, if requested.  */
!       if (flag_ssa_ccp)
! 	{
! 	  timevar_push (TV_SSA_CCP);
! 	  open_dump_file (DFI_ssa_ccp, decl);
! 
! 	  ssa_const_prop ();
! 
! 	  close_dump_file (DFI_ssa_ccp, print_rtl_with_bb, get_insns ());
! 	  timevar_pop (TV_SSA_CCP);
! 	}
! 
!       /* It would be useful to cleanup the CFG at this point, but block
! 	 merging and possibly other transformations might leave a PHI
! 	 node in the middle of a basic block, which is a strict no-no.  */
! 
!       /* The SSA implementation uses basic block numbers in its phi
! 	 nodes.  Thus, changing the control-flow graph or the basic
! 	 blocks, e.g., calling find_basic_blocks () or cleanup_cfg (),
! 	 may cause problems.  */
! 
!       if (flag_ssa_dce)
! 	{
! 	  /* Remove dead code.  */
! 
! 	  timevar_push (TV_SSA_DCE);
! 	  open_dump_file (DFI_ssa_dce, decl);
! 
! 	  insns = get_insns ();
! 	  ssa_eliminate_dead_code ();
! 
! 	  close_dump_file (DFI_ssa_dce, print_rtl_with_bb, insns);
! 	  timevar_pop (TV_SSA_DCE);
! 	}
! 
!       /* Convert from SSA form.  */
! 
!       timevar_push (TV_FROM_SSA);
!       open_dump_file (DFI_ussa, decl);
! 
!       convert_from_ssa ();
!       /* New registers have been created.  Rescan their usage.  */
!       reg_scan (insns, max_reg_num (), 1);
! 
!       close_dump_file (DFI_ussa, print_rtl_with_bb, insns);
!       timevar_pop (TV_FROM_SSA);
! 
        ggc_collect ();
      }
  
    timevar_push (TV_JUMP);
!   cleanup_cfg (optimize ? CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP: 0);
  
    /* Try to identify useless null pointer tests and delete them.  */
    if (flag_delete_null_pointer_checks)
--- 2656,2667 ----
       stuff at this time.  */
    if (optimize > 0 && flag_ssa)
      {
!       ssa_pass_driver (decl);
        ggc_collect ();
      }
  
    timevar_push (TV_JUMP);
!   cfg_cleanup_routine_driver (optimize ? CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP: 0);
  
    /* Try to identify useless null pointer tests and delete them.  */
    if (flag_delete_null_pointer_checks)
*************** rest_of_compilation (decl)
*** 2802,2811 ****
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
  
!       if (delete_null_pointer_checks (insns))
!         cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
  
!       close_dump_file (DFI_null, print_rtl_with_bb, insns);
      }
  
    /* Jump optimization, and the removal of NULL pointer checks, may
--- 2670,2678 ----
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
  
!       delete_null_pointer_checks_driver ();
  
!       close_dump_file (DFI_null, print_rtl_with_bb, get_insns ());
      }
  
    /* Jump optimization, and the removal of NULL pointer checks, may
*************** rest_of_compilation (decl)
*** 2816,2878 ****
    renumber_insns (rtl_dump_file);
    timevar_pop (TV_JUMP);
  
!   close_dump_file (DFI_jump, print_rtl_with_bb, insns);
  
    ggc_collect ();
  
!   /* Perform common subexpression elimination.
!      Nonzero value from `cse_main' means that jumps were simplified
!      and some code may now be unreachable, so do
!      jump optimization again.  */
  
    if (optimize > 0)
      {
        open_dump_file (DFI_cse, decl);
!       if (rtl_dump_file)
! 	dump_flow_info (rtl_dump_file);
!       timevar_push (TV_CSE);
! 
!       reg_scan (insns, max_reg_num (), 1);
! 
!       tem = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
!       if (tem)
! 	rebuild_jump_labels (insns);
!       purge_all_dead_edges (0);
! 
!       delete_trivially_dead_insns (insns, max_reg_num ());
! 
!       /* If we are not running more CSE passes, then we are no longer
! 	 expecting CSE to be run.  But always rerun it in a cheap mode.  */
!       cse_not_expected = !flag_rerun_cse_after_loop && !flag_gcse;
! 
!       if (tem || optimize > 1)
! 	cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
!       /* Try to identify useless null pointer tests and delete them.  */
!       if (flag_delete_null_pointer_checks)
! 	{
! 	  timevar_push (TV_JUMP);
! 
! 	  if (delete_null_pointer_checks (insns))
! 	    cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
! 	  timevar_pop (TV_JUMP);
! 	}
! 
!       /* The second pass of jump optimization is likely to have
!          removed a bunch more instructions.  */
!       renumber_insns (rtl_dump_file);
! 
!       timevar_pop (TV_CSE);
!       close_dump_file (DFI_cse, print_rtl_with_bb, insns);
      }
  
    open_dump_file (DFI_addressof, decl);
  
!   purge_addressof (insns);
    if (optimize)
      purge_all_dead_edges (0);
!   reg_scan (insns, max_reg_num (), 1);
  
!   close_dump_file (DFI_addressof, print_rtl, insns);
  
    ggc_collect ();
  
--- 2683,2709 ----
    renumber_insns (rtl_dump_file);
    timevar_pop (TV_JUMP);
  
!   close_dump_file (DFI_jump, print_rtl_with_bb, get_insns ());
  
    ggc_collect ();
  
!   /* Perform common subexpression elimination.  */
  
    if (optimize > 0)
      {
        open_dump_file (DFI_cse, decl);
!       main_cse_pass_driver ();
!       close_dump_file (DFI_cse, print_rtl_with_bb, get_insns ());
      }
  
    open_dump_file (DFI_addressof, decl);
  
!   purge_addressof (get_insns ());
    if (optimize)
      purge_all_dead_edges (0);
!   reg_scan (get_insns (), max_reg_num (), 1);
  
!   close_dump_file (DFI_addressof, print_rtl, get_insns ());
  
    ggc_collect ();
  
*************** rest_of_compilation (decl)
*** 2880,2939 ****
  
    if (optimize > 0 && flag_gcse)
      {
-       int save_csb, save_cfj;
-       int tem2 = 0;
- 
-       timevar_push (TV_GCSE);
        open_dump_file (DFI_gcse, decl);
! 
!       tem = gcse_main (insns, rtl_dump_file);
!       rebuild_jump_labels (insns);
!       delete_trivially_dead_insns (insns, max_reg_num ());
! 
!       save_csb = flag_cse_skip_blocks;
!       save_cfj = flag_cse_follow_jumps;
!       flag_cse_skip_blocks = flag_cse_follow_jumps = 0;
! 
!       /* If -fexpensive-optimizations, re-run CSE to clean up things done
! 	 by gcse.  */
!       if (flag_expensive_optimizations)
! 	{
! 	  timevar_push (TV_CSE);
! 	  reg_scan (insns, max_reg_num (), 1);
! 	  tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
! 	  purge_all_dead_edges (0);
! 	  delete_trivially_dead_insns (insns, max_reg_num ());
! 	  timevar_pop (TV_CSE);
! 	  cse_not_expected = !flag_rerun_cse_after_loop;
! 	}
! 
!       /* If gcse or cse altered any jumps, rerun jump optimizations to clean
! 	 things up.  Then possibly re-run CSE again.  */
!       while (tem || tem2)
! 	{
! 	  tem = tem2 = 0;
! 	  timevar_push (TV_JUMP);
! 	  rebuild_jump_labels (insns);
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
! 	  timevar_pop (TV_JUMP);
! 
! 	  if (flag_expensive_optimizations)
! 	    {
! 	      timevar_push (TV_CSE);
! 	      reg_scan (insns, max_reg_num (), 1);
! 	      tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
! 	      purge_all_dead_edges (0);
! 	      delete_trivially_dead_insns (insns, max_reg_num ());
! 	      timevar_pop (TV_CSE);
! 	    }
! 	}
! 
!       close_dump_file (DFI_gcse, print_rtl_with_bb, insns);
!       timevar_pop (TV_GCSE);
  
        ggc_collect ();
-       flag_cse_skip_blocks = save_csb;
-       flag_cse_follow_jumps = save_cfj;
  #ifdef ENABLE_CHECKING
        verify_flow_info ();
  #endif
--- 2711,2721 ----
  
    if (optimize > 0 && flag_gcse)
      {
        open_dump_file (DFI_gcse, decl);
!       gcse_pass_driver ();
!       close_dump_file (DFI_gcse, print_rtl_with_bb, get_insns ());
  
        ggc_collect ();
  #ifdef ENABLE_CHECKING
        verify_flow_info ();
  #endif
*************** rest_of_compilation (decl)
*** 2947,2989 ****
  
    if (optimize > 0 && flag_loop_optimize)
      {
-       int do_unroll, do_prefetch;
- 
-       timevar_push (TV_LOOP);
-       delete_dead_jumptables ();
-       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
        open_dump_file (DFI_loop, decl);
!       /* CFG is no longer maintained up-to-date.  */
!       free_bb_for_insn ();
! 
!       do_unroll = flag_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
!       do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
!       if (flag_rerun_loop_opt)
! 	{
! 	  cleanup_barriers ();
! 
! 	  /* We only want to perform unrolling once.  */
! 	  loop_optimize (insns, rtl_dump_file, do_unroll);
! 	  do_unroll = 0;
! 
! 	  /* The first call to loop_optimize makes some instructions
! 	     trivially dead.  We delete those instructions now in the
! 	     hope that doing so will make the heuristics in loop work
! 	     better and possibly speed up compilation.  */
! 	  delete_trivially_dead_insns (insns, max_reg_num ());
! 
! 	  /* The regscan pass is currently necessary as the alias
! 		  analysis code depends on this information.  */
! 	  reg_scan (insns, max_reg_num (), 1);
! 	}
!       cleanup_barriers ();
!       loop_optimize (insns, rtl_dump_file, do_unroll | LOOP_BCT | do_prefetch);
! 
!       /* Loop can create trivially dead instructions.  */
!       delete_trivially_dead_insns (insns, max_reg_num ());
!       close_dump_file (DFI_loop, print_rtl, insns);
!       timevar_pop (TV_LOOP);
!       find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
  
        ggc_collect ();
      }
--- 2729,2737 ----
  
    if (optimize > 0 && flag_loop_optimize)
      {
        open_dump_file (DFI_loop, decl);
!       old_loop_optimizer_pass_driver ();
!       close_dump_file (DFI_loop, print_rtl, get_insns ());
  
        ggc_collect ();
      }
*************** rest_of_compilation (decl)
*** 2991,3010 ****
    /* Perform jump bypassing and control flow optimizations.  */
    if (optimize > 0 && flag_gcse)
      {
-       timevar_push (TV_BYPASS);
        open_dump_file (DFI_bypass, decl);
  
!       cleanup_cfg (CLEANUP_EXPENSIVE);
!       tem = bypass_jumps (rtl_dump_file);
! 
!       if (tem)
!         {
!           rebuild_jump_labels (insns);
!           cleanup_cfg (CLEANUP_EXPENSIVE);
!           delete_trivially_dead_insns (insns, max_reg_num ());
!         }
  
!       close_dump_file (DFI_bypass, print_rtl_with_bb, insns);
        timevar_pop (TV_BYPASS);
  
        ggc_collect ();
--- 2739,2750 ----
    /* Perform jump bypassing and control flow optimizations.  */
    if (optimize > 0 && flag_gcse)
      {
        open_dump_file (DFI_bypass, decl);
+       timevar_push (TV_BYPASS);
  
!       bypass_jumps_driver ();
  
!       close_dump_file (DFI_bypass, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_BYPASS);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3021,3028 ****
    open_dump_file (DFI_cfg, decl);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
!   cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
! 	       | (flag_thread_jumps ? CLEANUP_THREADING : 0));
  
    /* It may make more sense to mark constant functions after dead code is
       eliminated by life_analysis, but we need to do it early, as -fprofile-arcs
--- 2761,2768 ----
    open_dump_file (DFI_cfg, decl);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
!   cfg_cleanup_routine_driver ((optimize ? CLEANUP_EXPENSIVE : 0)
! 			      | (flag_thread_jumps ? CLEANUP_THREADING : 0));
  
    /* It may make more sense to mark constant functions after dead code is
       eliminated by life_analysis, but we need to do it early, as -fprofile-arcs
*************** rest_of_compilation (decl)
*** 3032,3094 ****
       life_analysis rarely eliminates modification of external memory.
     */
    if (optimize)
!     mark_constant_function ();
  
!   close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
  
    /* Do branch profiling and static profile estimation passes.  */
    if (optimize > 0 || cfun->arc_profile || flag_branch_probabilities)
      {
-       struct loops loops;
- 
-       timevar_push (TV_BRANCH_PROB);
        open_dump_file (DFI_bp, decl);
!       if (cfun->arc_profile || flag_branch_probabilities)
! 	branch_prob ();
! 
!       /* Discover and record the loop depth at the head of each basic
! 	 block.  The loop infrastructure does the real job for us.  */
!       flow_loops_find (&loops, LOOP_TREE);
! 
!       if (rtl_dump_file)
! 	flow_loops_dump (&loops, rtl_dump_file, NULL, 0);
! 
!       /* Estimate using heuristics if no profiling info is available.  */
!       if (flag_guess_branch_prob)
! 	estimate_probability (&loops);
! 
!       flow_loops_free (&loops);
!       close_dump_file (DFI_bp, print_rtl_with_bb, insns);
!       timevar_pop (TV_BRANCH_PROB);
      }
    if (optimize >= 0)
      {
        open_dump_file (DFI_ce1, decl);
!       if (flag_if_conversion)
! 	{
! 	  timevar_push (TV_IFCVT);
! 	  if (rtl_dump_file)
! 	    dump_flow_info (rtl_dump_file);
! 	  cleanup_cfg (CLEANUP_EXPENSIVE);
! 	  reg_scan (insns, max_reg_num (), 0);
! 	  if_convert (0);
! 	  timevar_pop (TV_IFCVT);
! 	}
!       timevar_push (TV_JUMP);
!       cleanup_cfg (CLEANUP_EXPENSIVE);
!       reg_scan (insns, max_reg_num (), 0);
!       timevar_pop (TV_JUMP);
        close_dump_file (DFI_ce1, print_rtl_with_bb, get_insns ());
      }
    if (flag_tracer)
      {
        timevar_push (TV_TRACER);
        open_dump_file (DFI_tracer, decl);
!       if (rtl_dump_file)
! 	dump_flow_info (rtl_dump_file);
!       tracer ();
!       cleanup_cfg (CLEANUP_EXPENSIVE);
!       reg_scan (insns, max_reg_num (), 0);
        close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_TRACER);
      }
--- 2772,2801 ----
       life_analysis rarely eliminates modification of external memory.
     */
    if (optimize)
!     mark_constant_function_driver ();
  
!   close_dump_file (DFI_cfg, print_rtl_with_bb, get_insns ());
  
    /* Do branch profiling and static profile estimation passes.  */
    if (optimize > 0 || cfun->arc_profile || flag_branch_probabilities)
      {
        open_dump_file (DFI_bp, decl);
!       branch_prob_pass_driver ();
!       close_dump_file (DFI_bp, print_rtl_with_bb, get_insns ());
      }
+ 
    if (optimize >= 0)
      {
        open_dump_file (DFI_ce1, decl);
!       first_ifcvt_pass_driver ();
        close_dump_file (DFI_ce1, print_rtl_with_bb, get_insns ());
      }
+ 
    if (flag_tracer)
      {
        timevar_push (TV_TRACER);
        open_dump_file (DFI_tracer, decl);
!       tracer_driver ();
        close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_TRACER);
      }
*************** rest_of_compilation (decl)
*** 3098,3125 ****
    if (optimize > 0
        && flag_unswitch_loops)
      {
-       struct loops *loops;
        timevar_push (TV_LOOP);
        open_dump_file (DFI_loop2, decl);
-       if (rtl_dump_file)
- 	dump_flow_info (rtl_dump_file);
  
!       loops = loop_optimizer_init (rtl_dump_file);
  
-       if (loops)
- 	{
- 	  /* The optimalizations:  */
- 	  if (flag_unswitch_loops)
- 	    unswitch_loops (loops);
- 
- 	  loop_optimizer_finalize (loops, rtl_dump_file);
- 	}
- 
-       cleanup_cfg (CLEANUP_EXPENSIVE);
-       delete_trivially_dead_insns (insns, max_reg_num ());
-       reg_scan (insns, max_reg_num (), 0);
-       if (rtl_dump_file)
- 	dump_flow_info (rtl_dump_file);
        close_dump_file (DFI_loop2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_LOOP);
        ggc_collect ();
--- 2805,2815 ----
    if (optimize > 0
        && flag_unswitch_loops)
      {
        timevar_push (TV_LOOP);
        open_dump_file (DFI_loop2, decl);
  
!       new_loop_optimizer_pass_driver ();
  
        close_dump_file (DFI_loop2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_LOOP);
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3127,3150 ****
  
    if (flag_rerun_cse_after_loop)
      {
        timevar_push (TV_CSE2);
        open_dump_file (DFI_cse2, decl);
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
-       /* CFG is no longer maintained up-to-date.  */
-       tem = cse_main (insns, max_reg_num (), 1, rtl_dump_file);
-       purge_all_dead_edges (0);
-       delete_trivially_dead_insns (insns, max_reg_num ());
  
!       if (tem)
! 	{
! 	  timevar_push (TV_JUMP);
! 	  rebuild_jump_labels (insns);
! 	  cleanup_cfg (CLEANUP_EXPENSIVE);
! 	  timevar_pop (TV_JUMP);
! 	}
!       reg_scan (insns, max_reg_num (), 0);
!       close_dump_file (DFI_cse2, print_rtl_with_bb, insns);
        ggc_collect ();
        timevar_pop (TV_CSE2);
      }
--- 2817,2835 ----
  
    if (flag_rerun_cse_after_loop)
      {
+       int jumps_changed;
+ 
        timevar_push (TV_CSE2);
        open_dump_file (DFI_cse2, decl);
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
  
!       cse_driver (1, &jumps_changed);
!       if (jumps_changed)
! 	cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE);
!       reg_scan (get_insns (), max_reg_num (), 0);
! 
!       close_dump_file (DFI_cse2, print_rtl_with_bb, get_insns ());
        ggc_collect ();
        timevar_pop (TV_CSE2);
      }
*************** rest_of_compilation (decl)
*** 3159,3168 ****
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
!   life_analysis (insns, rtl_dump_file, PROP_FINAL);
    if (optimize)
!     cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_UPDATE_LIFE
! 		 | (flag_thread_jumps ? CLEANUP_THREADING : 0));
    timevar_pop (TV_FLOW);
  
    no_new_pseudos = 1;
--- 2844,2854 ----
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
!   life_analysis_driver (PROP_FINAL);
    if (optimize)
!     cfg_cleanup_routine_driver ((optimize ? CLEANUP_EXPENSIVE : 0)
! 				| CLEANUP_UPDATE_LIFE
! 				| (flag_thread_jumps ? CLEANUP_THREADING : 0));
    timevar_pop (TV_FLOW);
  
    no_new_pseudos = 1;
*************** rest_of_compilation (decl)
*** 3177,3193 ****
    if (optimize)
      {
        clear_bb_flags ();
!       if (!flag_new_regalloc && initialize_uninitialized_subregs ())
! 	{
! 	  /* Insns were inserted, so things might look a bit different.  */
! 	  insns = get_insns ();
! 	  update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! 					    PROP_LOG_LINKS | PROP_REG_INFO
! 					    | PROP_DEATH_NOTES);
! 	}
      }
  
!   close_dump_file (DFI_life, print_rtl_with_bb, insns);
  
    ggc_collect ();
  
--- 2863,2873 ----
    if (optimize)
      {
        clear_bb_flags ();
!       if (!flag_new_regalloc)
! 	initialize_uninitialized_subregs_driver ();
      }
  
!   close_dump_file (DFI_life, print_rtl_with_bb, get_insns ());
  
    ggc_collect ();
  
*************** rest_of_compilation (decl)
*** 3195,3221 ****
  
    if (optimize > 0)
      {
-       int rebuild_jump_labels_after_combine = 0;
- 
        timevar_push (TV_COMBINE);
        open_dump_file (DFI_combine, decl);
  
!       rebuild_jump_labels_after_combine
! 	= combine_instructions (insns, max_reg_num ());
! 
!       /* Combining insns may have turned an indirect jump into a
! 	 direct jump.  Rebuild the JUMP_LABEL fields of jumping
! 	 instructions.  */
!       if (rebuild_jump_labels_after_combine)
! 	{
! 	  timevar_push (TV_JUMP);
! 	  rebuild_jump_labels (insns);
! 	  timevar_pop (TV_JUMP);
! 
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
! 	}
  
!       close_dump_file (DFI_combine, print_rtl_with_bb, insns);
        timevar_pop (TV_COMBINE);
  
        ggc_collect ();
--- 2875,2886 ----
  
    if (optimize > 0)
      {
        timevar_push (TV_COMBINE);
        open_dump_file (DFI_combine, decl);
  
!       combine_instructions_driver ();
  
!       close_dump_file (DFI_combine, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_COMBINE);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3229,3238 ****
        open_dump_file (DFI_ce2, decl);
  
        no_new_pseudos = 0;
!       if_convert (1);
        no_new_pseudos = 1;
  
!       close_dump_file (DFI_ce2, print_rtl_with_bb, insns);
        timevar_pop (TV_IFCVT);
      }
  
--- 2894,2903 ----
        open_dump_file (DFI_ce2, decl);
  
        no_new_pseudos = 0;
!       if_conversion_driver (1);
        no_new_pseudos = 1;
  
!       close_dump_file (DFI_ce2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_IFCVT);
      }
  
*************** rest_of_compilation (decl)
*** 3243,3252 ****
        timevar_push (TV_REGMOVE);
        open_dump_file (DFI_regmove, decl);
  
!       regmove_optimize (insns, max_reg_num (), rtl_dump_file);
  
!       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
!       close_dump_file (DFI_regmove, print_rtl_with_bb, insns);
        timevar_pop (TV_REGMOVE);
  
        ggc_collect ();
--- 2908,2916 ----
        timevar_push (TV_REGMOVE);
        open_dump_file (DFI_regmove, decl);
  
!       regmove_driver ();
  
!       close_dump_file (DFI_regmove, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_REGMOVE);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3254,3275 ****
  
    /* Do unconditional splitting before register allocation to allow machine
       description to add extra information not needed previously.  */
!   split_all_insns (1);
  
  #ifdef OPTIMIZE_MODE_SWITCHING
    timevar_push (TV_MODE_SWITCH);
! 
!   no_new_pseudos = 0;
!   optimize_mode_switching (NULL);
!   no_new_pseudos = 1;
! 
    timevar_pop (TV_MODE_SWITCH);
  #endif
  
    /* Any of the several passes since flow1 will have munged register
       lifetime data a bit.  We need it to be up to date for scheduling
       (see handling of reg_known_equiv in init_alias_analysis).  */
!   recompute_reg_usage (insns, !optimize_size);
  
    timevar_push (TV_SCHED);
  
--- 2918,2935 ----
  
    /* Do unconditional splitting before register allocation to allow machine
       description to add extra information not needed previously.  */
!   split_insns_driver (1);
  
  #ifdef OPTIMIZE_MODE_SWITCHING
    timevar_push (TV_MODE_SWITCH);
!   optimize_mode_switching_driver ();
    timevar_pop (TV_MODE_SWITCH);
  #endif
  
    /* Any of the several passes since flow1 will have munged register
       lifetime data a bit.  We need it to be up to date for scheduling
       (see handling of reg_known_equiv in init_alias_analysis).  */
!   recompute_reg_usage (get_insns (), !optimize_size);
  
    timevar_push (TV_SCHED);
  
*************** rest_of_compilation (decl)
*** 3284,3292 ****
        /* Do control and data sched analysis,
  	 and write some of the results to dump file.  */
  
!       schedule_insns (rtl_dump_file);
  
!       close_dump_file (DFI_sched, print_rtl_with_bb, insns);
      }
  #endif
    timevar_pop (TV_SCHED);
--- 2944,2952 ----
        /* Do control and data sched analysis,
  	 and write some of the results to dump file.  */
  
!       schedule_insns_driver ();
  
!       close_dump_file (DFI_sched, print_rtl_with_bb, get_insns ());
      }
  #endif
    timevar_pop (TV_SCHED);
*************** rest_of_compilation (decl)
*** 3298,3406 ****
       epilogue thus changing register elimination offsets.  */
    current_function_is_leaf = leaf_function_p ();
  
!   timevar_push (TV_LOCAL_ALLOC);
!   open_dump_file (DFI_lreg, decl);
! 
!   /* Allocate pseudo-regs that are used only within 1 basic block.
! 
!      RUN_JUMP_AFTER_RELOAD records whether or not we need to rerun the
!      jump optimizer after register allocation and reloading are finished.  */
! 
!   if (flag_new_regalloc)
!     {
!       delete_trivially_dead_insns (insns, max_reg_num ());
!       reg_alloc ();
! 
!       timevar_pop (TV_LOCAL_ALLOC);
!       if (dump_file[DFI_lreg].enabled)
!         {
!           timevar_push (TV_DUMP);
! 
!           close_dump_file (DFI_lreg, NULL, NULL);
!           timevar_pop (TV_DUMP);
!         }
! 
!       /* XXX clean up the whole mess to bring live info in shape again.  */
!       timevar_push (TV_GLOBAL_ALLOC);
!       open_dump_file (DFI_greg, decl);
! 
!       build_insn_chain (insns);
!       failure = reload (insns, 0);
! 
!       timevar_pop (TV_GLOBAL_ALLOC);
! 
!       if (dump_file[DFI_greg].enabled)
!         {
!           timevar_push (TV_DUMP);
! 
!           dump_global_regs (rtl_dump_file);
! 
!           close_dump_file (DFI_greg, print_rtl_with_bb, insns);
!           timevar_pop (TV_DUMP);
!         }
! 
!       if (failure)
!         goto exit_rest_of_compilation;
!       reload_completed = 1;
!       rebuild_label_notes_after_reload = 0;
!     }
!   else
!     {
!       /* Allocate the reg_renumber array.  */
!       allocate_reg_info (max_regno, FALSE, TRUE);
! 
!       /* And the reg_equiv_memory_loc array.  */
!       reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
! 
!       allocate_initial_values (reg_equiv_memory_loc);
! 
!       regclass (insns, max_reg_num (), rtl_dump_file);
!       rebuild_label_notes_after_reload = local_alloc ();
! 
!       timevar_pop (TV_LOCAL_ALLOC);
! 
!       if (dump_file[DFI_lreg].enabled)
! 	{
! 	  timevar_push (TV_DUMP);
! 
! 	  dump_flow_info (rtl_dump_file);
! 	  dump_local_alloc (rtl_dump_file);
! 
! 	  close_dump_file (DFI_lreg, print_rtl_with_bb, insns);
! 	  timevar_pop (TV_DUMP);
! 	}
! 
!       ggc_collect ();
! 
!       timevar_push (TV_GLOBAL_ALLOC);
!       open_dump_file (DFI_greg, decl);
! 
!       /* If optimizing, allocate remaining pseudo-regs.  Do the reload
! 	 pass fixing up any insns that are invalid.  */
! 
!       if (optimize)
! 	failure = global_alloc (rtl_dump_file);
!       else
! 	{
! 	  build_insn_chain (insns);
! 	  failure = reload (insns, 0);
! 	}
! 
!       timevar_pop (TV_GLOBAL_ALLOC);
! 
!       if (dump_file[DFI_greg].enabled)
! 	{
! 	  timevar_push (TV_DUMP);
! 
! 	  dump_global_regs (rtl_dump_file);
  
! 	  close_dump_file (DFI_greg, print_rtl_with_bb, insns);
! 	  timevar_pop (TV_DUMP);
! 	}
! 
!       if (failure)
! 	goto exit_rest_of_compilation;
!     }
  
    ggc_collect ();
  
--- 2958,2969 ----
       epilogue thus changing register elimination offsets.  */
    current_function_is_leaf = leaf_function_p ();
  
!   recompute_reg_usage (get_insns (), ! optimize_size);
  
!   /* Run register allocation pass.  */
!   regalloc_pass_driver (decl, &failure);
!   if (failure)
!     goto exit_rest_of_compilation;
  
    ggc_collect ();
  
*************** rest_of_compilation (decl)
*** 3410,3433 ****
    if (optimize > 0)
      {
        timevar_push (TV_RELOAD_CSE_REGS);
!       reload_cse_regs (insns);
        timevar_pop (TV_RELOAD_CSE_REGS);
      }
  
!   /* Register allocation and reloading may have turned an indirect jump into
!      a direct jump.  If so, we must rebuild the JUMP_LABEL fields of
!      jumping instructions.  */
!   if (rebuild_label_notes_after_reload)
!     {
!       timevar_push (TV_JUMP);
! 
!       rebuild_jump_labels (insns);
!       purge_all_dead_edges (0);
! 
!       timevar_pop (TV_JUMP);
!     }
! 
!   close_dump_file (DFI_postreload, print_rtl_with_bb, insns);
  
    /* Re-create the death notes which were deleted during reload.  */
    timevar_push (TV_FLOW2);
--- 2973,2983 ----
    if (optimize > 0)
      {
        timevar_push (TV_RELOAD_CSE_REGS);
!       cse_post_reload_driver ();
        timevar_pop (TV_RELOAD_CSE_REGS);
      }
  
!   close_dump_file (DFI_postreload, print_rtl_with_bb, get_insns ());
  
    /* Re-create the death notes which were deleted during reload.  */
    timevar_push (TV_FLOW2);
*************** rest_of_compilation (decl)
*** 3439,3459 ****
  
    /* If optimizing, then go ahead and split insns now.  */
    if (optimize > 0)
!     split_all_insns (0);
  
!   cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
  
    /* On some machines, the prologue and epilogue code, or parts thereof,
       can be represented as RTL.  Doing so lets us schedule insns between
       it and the rest of the code and also allows delayed branch
       scheduling to operate in the epilogue.  */
!   thread_prologue_and_epilogue_insns (insns);
  
    if (optimize)
      {
!       life_analysis (insns, rtl_dump_file, PROP_FINAL);
!       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! 		   | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
  
        /* This is kind of a heuristic.  We need to run combine_stack_adjustments
           even for machines with possibly nonzero RETURN_POPS_ARGS
--- 2989,3009 ----
  
    /* If optimizing, then go ahead and split insns now.  */
    if (optimize > 0)
!     split_insns_driver (0);
  
!   cfg_cleanup_routine_driver (optimize ? CLEANUP_EXPENSIVE : 0);
  
    /* On some machines, the prologue and epilogue code, or parts thereof,
       can be represented as RTL.  Doing so lets us schedule insns between
       it and the rest of the code and also allows delayed branch
       scheduling to operate in the epilogue.  */
!   add_prologue_and_epilogue_driver ();
  
    if (optimize)
      {
!       life_analysis_driver (PROP_FINAL);
!       cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! 				  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
  
        /* This is kind of a heuristic.  We need to run combine_stack_adjustments
           even for machines with possibly nonzero RETURN_POPS_ARGS
*************** rest_of_compilation (decl)
*** 3462,3475 ****
  #ifndef PUSH_ROUNDING
        if (!ACCUMULATE_OUTGOING_ARGS)
  #endif
! 	combine_stack_adjustments ();
  
        ggc_collect ();
      }
  
    flow2_completed = 1;
  
!   close_dump_file (DFI_flow2, print_rtl_with_bb, insns);
    timevar_pop (TV_FLOW2);
  
  #ifdef HAVE_peephole2
--- 3012,3025 ----
  #ifndef PUSH_ROUNDING
        if (!ACCUMULATE_OUTGOING_ARGS)
  #endif
! 	combine_stack_adjustments_driver ();
  
        ggc_collect ();
      }
  
    flow2_completed = 1;
  
!   close_dump_file (DFI_flow2, print_rtl_with_bb, get_insns ());
    timevar_pop (TV_FLOW2);
  
  #ifdef HAVE_peephole2
*************** rest_of_compilation (decl)
*** 3478,3486 ****
        timevar_push (TV_PEEPHOLE2);
        open_dump_file (DFI_peephole2, decl);
  
!       peephole2_optimize (rtl_dump_file);
  
!       close_dump_file (DFI_peephole2, print_rtl_with_bb, insns);
        timevar_pop (TV_PEEPHOLE2);
      }
  #endif
--- 3028,3036 ----
        timevar_push (TV_PEEPHOLE2);
        open_dump_file (DFI_peephole2, decl);
  
!       peephole2_driver ();
  
!       close_dump_file (DFI_peephole2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_PEEPHOLE2);
      }
  #endif
*************** rest_of_compilation (decl)
*** 3491,3501 ****
        open_dump_file (DFI_rnreg, decl);
  
        if (flag_rename_registers)
! 	regrename_optimize ();
        if (flag_cprop_registers)
! 	copyprop_hardreg_forward ();
  
!       close_dump_file (DFI_rnreg, print_rtl_with_bb, insns);
        timevar_pop (TV_RENAME_REGISTERS);
      }
  
--- 3041,3051 ----
        open_dump_file (DFI_rnreg, decl);
  
        if (flag_rename_registers)
! 	register_renaming_driver ();
        if (flag_cprop_registers)
! 	copyprop_hardreg_forward_driver ();
  
!       close_dump_file (DFI_rnreg, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_RENAME_REGISTERS);
      }
  
*************** rest_of_compilation (decl)
*** 3504,3517 ****
        timevar_push (TV_IFCVT2);
        open_dump_file (DFI_ce3, decl);
  
!       if_convert (1);
  
!       close_dump_file (DFI_ce3, print_rtl_with_bb, insns);
        timevar_pop (TV_IFCVT2);
      }
  #ifdef STACK_REGS
    if (optimize)
!     split_all_insns (1);
  #endif
  
  #ifdef INSN_SCHEDULING
--- 3054,3067 ----
        timevar_push (TV_IFCVT2);
        open_dump_file (DFI_ce3, decl);
  
!       if_conversion_driver (1);
  
!       close_dump_file (DFI_ce3, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_IFCVT2);
      }
  #ifdef STACK_REGS
    if (optimize)
!     split_insns_driver (1);
  #endif
  
  #ifdef INSN_SCHEDULING
*************** rest_of_compilation (decl)
*** 3523,3533 ****
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
!       split_all_insns (1);
  
!       schedule_insns (rtl_dump_file);
  
!       close_dump_file (DFI_sched2, print_rtl_with_bb, insns);
        timevar_pop (TV_SCHED2);
  
        ggc_collect ();
--- 3073,3083 ----
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
!       split_insns_driver (1);
  
!       schedule_insns_driver ();
  
!       close_dump_file (DFI_sched2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_SCHED2);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3543,3551 ****
    timevar_push (TV_REG_STACK);
    open_dump_file (DFI_stack, decl);
  
!   reg_to_stack (insns, rtl_dump_file);
  
!   close_dump_file (DFI_stack, print_rtl_with_bb, insns);
    timevar_pop (TV_REG_STACK);
  
    ggc_collect ();
--- 3093,3101 ----
    timevar_push (TV_REG_STACK);
    open_dump_file (DFI_stack, decl);
  
!   regstack_driver ();
  
!   close_dump_file (DFI_stack, print_rtl_with_bb, get_insns ());
    timevar_pop (TV_REG_STACK);
  
    ggc_collect ();
*************** rest_of_compilation (decl)
*** 3559,3576 ****
  	 splitting possibly introduced more crossjumping opportunities.
  	 Except that we can't actually run crossjumping without running
  	 another DCE pass, which we can't do after reg-stack.  */
!       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
! 		   | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
        if (flag_reorder_blocks)
! 	{
! 	  reorder_basic_blocks ();
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
! 	}
  
!       close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
        timevar_pop (TV_REORDER_BLOCKS);
      }
!   compute_alignments ();
  
    /* CFG is no longer maintained up-to-date.  */
    free_bb_for_insn ();
--- 3109,3123 ----
  	 splitting possibly introduced more crossjumping opportunities.
  	 Except that we can't actually run crossjumping without running
  	 another DCE pass, which we can't do after reg-stack.  */
!       cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
! 				  | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
        if (flag_reorder_blocks)
! 	reorder_basic_blocks_driver ();
  
!       close_dump_file (DFI_bbro, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_REORDER_BLOCKS);
      }
!   compute_alignments_driver ();
  
    /* CFG is no longer maintained up-to-date.  */
    free_bb_for_insn ();
*************** rest_of_compilation (decl)
*** 3580,3594 ****
    timevar_push (TV_MACH_DEP);
    open_dump_file (DFI_mach, decl);
  
!   MACHINE_DEPENDENT_REORG (insns);
  
!   close_dump_file (DFI_mach, print_rtl, insns);
    timevar_pop (TV_MACH_DEP);
  
    ggc_collect ();
  #endif
  
!   purge_line_number_notes (insns);
    cleanup_barriers ();
  
    /* If a scheduling pass for delayed branches is to be done,
--- 3127,3141 ----
    timevar_push (TV_MACH_DEP);
    open_dump_file (DFI_mach, decl);
  
!   MACHINE_DEPENDENT_REORG (get_insns ());
  
!   close_dump_file (DFI_mach, print_rtl, get_insns ());
    timevar_pop (TV_MACH_DEP);
  
    ggc_collect ();
  #endif
  
!   purge_line_number_notes (get_insns ());
    cleanup_barriers ();
  
    /* If a scheduling pass for delayed branches is to be done,
*************** rest_of_compilation (decl)
*** 3600,3608 ****
        timevar_push (TV_DBR_SCHED);
        open_dump_file (DFI_dbr, decl);
  
!       dbr_schedule (insns, rtl_dump_file);
  
!       close_dump_file (DFI_dbr, print_rtl, insns);
        timevar_pop (TV_DBR_SCHED);
  
        ggc_collect ();
--- 3147,3155 ----
        timevar_push (TV_DBR_SCHED);
        open_dump_file (DFI_dbr, decl);
  
!       dbr_schedule_driver ();
  
!       close_dump_file (DFI_dbr, print_rtl, get_insns ());
        timevar_pop (TV_DBR_SCHED);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3611,3617 ****
  
  #if defined (HAVE_ATTR_length) && !defined (STACK_REGS)
    timevar_push (TV_SHORTEN_BRANCH);
!   split_all_insns_noflow ();
    timevar_pop (TV_SHORTEN_BRANCH);
  #endif
  
--- 3158,3164 ----
  
  #if defined (HAVE_ATTR_length) && !defined (STACK_REGS)
    timevar_push (TV_SHORTEN_BRANCH);
!   split_all_insns_noflow_driver ();
    timevar_pop (TV_SHORTEN_BRANCH);
  #endif
  
*************** rest_of_compilation (decl)
*** 3619,3625 ****
  
    /* Shorten branches.  */
    timevar_push (TV_SHORTEN_BRANCH);
!   shorten_branches (get_insns ());
    timevar_pop (TV_SHORTEN_BRANCH);
  
    set_nothrow_function_flags ();
--- 3166,3172 ----
  
    /* Shorten branches.  */
    timevar_push (TV_SHORTEN_BRANCH);
!   shorten_branches_driver ();
    timevar_pop (TV_SHORTEN_BRANCH);
  
    set_nothrow_function_flags ();
*************** rest_of_compilation (decl)
*** 3647,3654 ****
      fnname = XSTR (x, 0);
  
      assemble_start_function (decl, fnname);
!     final_start_function (insns, asm_out_file, optimize);
!     final (insns, asm_out_file, optimize, 0);
      final_end_function ();
  
  #ifdef IA64_UNWIND_INFO
--- 3194,3201 ----
      fnname = XSTR (x, 0);
  
      assemble_start_function (decl, fnname);
!     final_start_function (get_insns (), asm_out_file, optimize);
!     final (get_insns (), asm_out_file, optimize, 0);
      final_end_function ();
  
  #ifdef IA64_UNWIND_INFO
Index: toplev.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.h,v
retrieving revision 1.89
diff -c -3 -p -r1.89 toplev.h
*** toplev.h	4 Aug 2002 16:21:02 -0000	1.89
--- toplev.h	14 Feb 2003 22:04:51 -0000
*************** extern void fnotice			PARAMS ((FILE *, c
*** 106,111 ****
--- 106,159 ----
  extern int wrapup_global_declarations   PARAMS ((union tree_node **, int));
  extern void check_global_declarations   PARAMS ((union tree_node **, int));
  
+ /* Enumerate the extant dump files.  */
+ 
+ enum dump_file_index
+ {
+   DFI_rtl,
+   DFI_sibling,
+   DFI_eh,
+   DFI_jump,
+   DFI_ssa,
+   DFI_ssa_ccp,
+   DFI_ssa_dce,
+   DFI_ussa,
+   DFI_null,
+   DFI_cse,
+   DFI_addressof,
+   DFI_gcse,
+   DFI_loop,
+   DFI_bypass,
+   DFI_cfg,
+   DFI_bp,
+   DFI_ce1,
+   DFI_tracer,
+   DFI_loop2,
+   DFI_cse2,
+   DFI_life,
+   DFI_combine,
+   DFI_ce2,
+   DFI_regmove,
+   DFI_sched,
+   DFI_lreg,
+   DFI_greg,
+   DFI_postreload,
+   DFI_flow2,
+   DFI_peephole2,
+   DFI_rnreg,
+   DFI_ce3,
+   DFI_sched2,
+   DFI_stack,
+   DFI_bbro,
+   DFI_mach,
+   DFI_dbr,
+   DFI_MAX
+ };
+ 
+ extern int open_dump_file PARAMS ((enum dump_file_index, tree));
+ extern void close_dump_file PARAMS ((enum dump_file_index,
+ 				     void (*) (FILE *, rtx), rtx));
+ 
  extern const char *progname;
  extern const char *dump_base_name;
  extern const char *aux_base_name;
Index: tracer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tracer.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 tracer.c
*** tracer.c	24 Jan 2003 20:27:02 -0000	1.7
--- tracer.c	14 Feb 2003 22:04:51 -0000
***************
*** 47,52 ****
--- 47,53 ----
  #include "flags.h"
  #include "params.h"
  #include "profile.h"
+ #include "passes.h"
  
  static int count_insns		PARAMS ((basic_block));
  static bool ignore_bb_p		PARAMS ((basic_block));
*************** layout_superblocks ()
*** 361,371 ****
  
  /* Main entry point to this file.  */
  
! void
  tracer ()
  {
    if (n_basic_blocks <= 1)
!     return;
    cfg_layout_initialize (NULL);
    mark_dfs_back_edges ();
    if (rtl_dump_file)
--- 362,372 ----
  
  /* Main entry point to this file.  */
  
! bool
  tracer ()
  {
    if (n_basic_blocks <= 1)
!     return false;
    cfg_layout_initialize (NULL);
    mark_dfs_back_edges ();
    if (rtl_dump_file)
*************** tracer ()
*** 376,380 ****
      dump_flow_info (rtl_dump_file);
    cfg_layout_finalize ();
    /* Merge basic blocks in duplicated traces.  */
!   cleanup_cfg (CLEANUP_EXPENSIVE);
  }
--- 377,383 ----
      dump_flow_info (rtl_dump_file);
    cfg_layout_finalize ();
    /* Merge basic blocks in duplicated traces.  */
!   cfg_cleanup_routine_driver (CLEANUP_EXPENSIVE);
! 
!   return true;
  }
/* passes.c -- definitions of passes and internal structures of gcc.
   Copyright (C) 2003 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.

*/

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "toplev.h"

/* Requiered because of actions.  */
#include "rtl.h"
#include "regs.h"
#include "basic-block.h"
#include "except.h"
#include "output.h"
#include "timevar.h"
#include "ssa.h"
#include "cfgloop.h"
#include "gcse-globals.h"
#include "flags.h"
#include "vpt.h"
#include "ggc.h"
#include "insn-config.h"
#include "reload.h"
#include "integrate.h"
#include "recog.h"

#include "passes.h"


/* Structure state names.  */
const char *str_state_name[SS_MAX] =
{
  "NONE",
  "DIRTY",
  "OK"
};

/* Names of structures.  */
const char *structure_name[STR_MAX] =
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  NAME,
#include "structures.def"
};

/* Types of structures.  */
enum str_type structure_type[STR_MAX] =
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  ST_##TYPE,
#include "structures.def"
};

/* Structure states.  */
enum str_state structure_state[STR_MAX];

/* Prototypes for helper functions.  */
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  static bool create_structure_##ID##_helper PARAMS ((void));	\
  static bool update_structure_##ID##_helper PARAMS ((void));	\
  static bool destroy_structure_##ID##_helper PARAMS ((void));
#include "structures.def"

/* The helper and manipulation functions.  */
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
static bool							\
create_structure_##ID##_helper ()				\
{								\
  CREATE							\
}								\
								\
static bool							\
update_structure_##ID##_helper ()				\
{								\
  UPDATE							\
}								\
								\
static bool							\
destroy_structure_##ID##_helper ()				\
{								\
  DESTROY							\
}								\
								\
void								\
preserve_implied_structures_##ID ()				\
{								\
  IMPLIES							\
}								\
								\
bool								\
create_structure_##ID ()					\
{								\
  bool ret;							\
								\
  ASSERT_STRUCTURE (ID, NONE);					\
  ret = create_structure_##ID##_helper ();			\
  if (ret)							\
    FORCE_STRUCTURE (ID, OK);					\
  return ret;							\
}								\
								\
bool								\
update_structure_##ID ()					\
{								\
  bool ret;							\
								\
  ASSERT_STRUCTURE (ID, DIRTY);					\
  ret = update_structure_##ID##_helper ();			\
  if (ret)							\
    FORCE_STRUCTURE (ID, OK);					\
  return ret;							\
}								\
								\
bool								\
destroy_structure_##ID ()					\
{								\
  bool ret;							\
								\
  if (STATE_OF_STRUCTURE (ID) == SS_NONE)			\
    {								\
      error ("State of %s is expected not to be %s.",		\
	     structure_name[STR_##ID],				\
	     str_state_name[SS_NONE]);				\
      abort ();							\
    }								\
  ret = destroy_structure_##ID##_helper ();			\
  if (ret)							\
    FORCE_STRUCTURE (ID, NONE);					\
  return ret;							\
}
#include "structures.def"

/* Initialize states of all structures.  */
void
init_structure_states ()
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  FORCE_STRUCTURE (ID, INIT);
#include "structures.def"
}

/* Release all dirty structures.  */
void
release_dirty_structures ()
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  if (STATE_OF_STRUCTURE (ID) == SS_DIRTY)			\
    destroy_structure_##ID ();
#include "structures.def"
}

/* Finalize all structures.  */
void
finish_structures ()
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  if (STATE_OF_STRUCTURE (ID) != SS_NONE)			\
    destroy_structure_##ID ();
#include "structures.def"
}

/* The pass manipulation functions.  */

/* Structures preserved by pass.  */
int pass_preserves[STR_MAX];
int pass_preserves_all;

/* Updates states of the structures according to list of preserved ones.  */
void
update_structures (preserves, preserves_all)
     int preserves[STR_MAX];
     int preserves_all;
{
  enum structures id;

  if (preserves_all)
    return;
  
  for (id = 0; id < STR_MAX; id++)
    {
      if (preserves[id] || structure_type[id] == ST_DURABLE)
	continue;

      if (structure_state[id] == SS_OK)
	structure_state[id] = SS_DIRTY;
    }
}

/* The prototypes for generated functions:  */

#undef DEF_PASS
#define DEF_PASS(ID, NAME, DESC, PARS, NPARS, HEADER, TYPE, VALUE, INIT, DONE, RUN) \
static TYPE run_pass_##ID##_helper PARAMS (PARS);
#include "passes.def"

/* The generated functions:  */

#undef DEF_PASS
#define DEF_PASS(ID, NAME, DESC, PARS, NPARS, HEADER, TYPE, VALUE, INIT, DONE, RUN) \
void								\
initialize_pass_##ID NPARS					\
HEADER								\
{								\
  INIT								\
}								\
								\
TYPE pass_##ID##_return_value_temp;				\
void								\
finalize_pass_##ID NPARS					\
HEADER								\
{								\
  TYPE VALUE;							\
  VALUE = pass_##ID##_return_value_temp;			\
  DONE								\
}								\
								\
static TYPE							\
run_pass_##ID##_helper NPARS					\
HEADER								\
{								\
  RUN								\
}								\
								\
TYPE								\
run_pass_##ID NPARS						\
HEADER								\
{								\
  int pass_preserves[STR_MAX];					\
  int pass_preserves_all = 0;					\
  TYPE VALUE;							\
  memset (pass_preserves, 0, sizeof (pass_preserves));		\
								\
  INIT								\
  VALUE = run_pass_##ID##_helper NPARS;				\
  DONE								\
  update_structures (pass_preserves, pass_preserves_all);	\
								\
  return VALUE;							\
}
#include "passes.def"
/* passes.h -- definitions of passes and internal structures of gcc.
   Copyright (C) 2003 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.

*/

/* Structures:  */

/* Generate prototypes for structure manipulation functions.  */
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  void preserve_implied_structures_##ID PARAMS ((void));	\
  bool create_structure_##ID PARAMS ((void));			\
  bool update_structure_##ID PARAMS ((void));			\
  bool destroy_structure_##ID PARAMS ((void));
#include "structures.def"

/* Enumeration of possible structure states.  */
enum str_state
{
  SS_NONE,	/* Does not exist.  */
  SS_DIRTY,	/* The structure is here, but needs to be updated.  */
  SS_OK,	/* The structure is ready.  */
  SS_MAX
};

/* Their names.  */
extern const char *str_state_name[SS_MAX];

/* Type of structure.  */
enum str_type
{
  ST_FRAGILE,
  ST_DURABLE
};

/* Enumeration of all structures.  */
enum structures
{
#undef DEF_STRUCTURE
#define DEF_STRUCTURE(ID, NAME, DESC, INIT, TYPE, IMPLIES, CREATE, UPDATE, DESTROY) \
  STR_##ID,
#include "structures.def"
  STR_MAX
};

/* Their names.  */
extern const char *structure_name[STR_MAX];

/* And types.  */
extern enum str_type structure_type[STR_MAX];

/* Structure states are stored here.  */
extern enum str_state structure_state[STR_MAX];

/* Structure manipulation macros, for description see structures.def.  */
#define STATE_OF_STRUCTURE(ID)					\
  structure_state[STR_##ID]

#define ASSERT_STRUCTURE(ID, STATE)				\
  do								\
    {								\
      if (STATE_OF_STRUCTURE (ID) != SS_##STATE)		\
	{							\
	  error ("State of %s is expected to be %s.",		\
		 structure_name[STR_##ID],			\
		 str_state_name[SS_##STATE]);			\
	  abort ();						\
	}							\
    }								\
  while (0)

#define FORCE_STRUCTURE(ID, STATE)				\
  do								\
    {								\
      if (SS_DIRTY != SS_##STATE				\
	  || STATE_OF_STRUCTURE (ID) != SS_NONE)		\
	STATE_OF_STRUCTURE (ID) = SS_##STATE;			\
    }								\
  while (0)

#define REQ_STRUCTURE(ID, STATE)				\
  do								\
    {								\
      enum str_state state = SS_##STATE;			\
      enum structures id = STR_##ID;				\
      const char *str_name = structure_name[id];		\
								\
      if (state == SS_DIRTY)					\
	{							\
	  error ("Requested to bring %s into %s state.",	\
		 str_name, str_state_name[SS_DIRTY]);		\
	  abort ();						\
	}							\
      if (structure_state[id] == state)				\
	break;							\
								\
      if (state == SS_NONE)					\
	{							\
	  if (destroy_structure_##ID ())			\
	    break;						\
	  error ("Failed to destroy %s.", str_name);		\
	  abort ();						\
	}							\
								\
      if (state != SS_OK)					\
	abort ();  /* Just for sure.  */			\
      if (structure_state[id] == SS_DIRTY)			\
	{							\
	  if (update_structure_##ID ())				\
	    break;						\
	  if (!destroy_structure_##ID ())			\
	    {							\
	      error ("Failed to update %s.", str_name);		\
	      abort ();						\
	    }							\
	}							\
      if (structure_state[id] != SS_NONE)			\
	{							\
	  error ("Information about state of %s is inconsistent.", \
		 str_name);					\
	  abort ();						\
	}							\
								\
      if (create_structure_##ID ())				\
	break;							\
								\
      error ("Failed to %s %s.",				\
	     state == SS_OK ? "create" : "update",		\
	     str_name);						\
      abort ();							\
    }								\
  while (0)

/* Exported functions.  */
void init_structure_states	PARAMS ((void));
void release_dirty_structures	PARAMS ((void));
void finish_structures		PARAMS ((void));

/* Passes:  */

/* Enumeration of all passes.  */
enum passes
{
#undef DEF_PASS
#define DEF_PASS(ID, NAME, DESC, PARS, NPARS, HEADER, TYPE, VALUE, INIT, DONE, RUN) \
  PASS_##ID,
#include "passes.def"
  PASS_MAX
};

/* Structures preserved by pass.  */
extern int pass_preserves[STR_MAX];
extern int pass_preserves_all;

/* Temporary variables for passing return value to pass finalization.  */
#undef DEF_PASS
#define DEF_PASS(ID, NAME, DESC, PARS, NPARS, HEADER, TYPE, VALUE, INIT, DONE, RUN) \
extern TYPE pass_##ID##_return_value_temp;
#include "passes.def"

/* Pass manipulation macros, for description see passes.def.  */

#define REQ_DEFAULT_STRUCTURES					\
  do								\
    {								\
      REQ_STRUCTURE (cfg, OK);					\
      REQ_STRUCTURE (ssa, NONE);				\
      REQ_STRUCTURE (loops_for_loop2, NONE);			\
    }								\
  while (0)

#define PRESERVE_STRUCTURE(ID)					\
  if (!pass_preserves[STR_##ID])				\
    {								\
      pass_preserves[STR_##ID] = 1;				\
      preserve_implied_structures_##ID ();			\
    }

#define PRESERVE_ALL_STRUCTURES					\
  pass_preserves_all = 1

#define BEGIN_PASS (ID, PARS)					\
  {								\
    int __pass_preserves[STR_MAX];				\
    int __pass_preserves_all = pass_preserves_all;		\
    enum passes __pass_id = PASS_#ID;				\
    memcpy (__pass_preserves, pass_preserves, sizeof (pass_preserves)); \
    pass_preserves_all = 0;					\
    memset (pass_preserves, 0, sizeof (pass_preserves));	\
								\
    initialize_pass_##ID PARS;

#define END_PASS (ID, PARS, RETURN_VALUE)			\
    if (__pass_id != PASS_#ID)					\
      {								\
	error ("Mismatched END_PASS.");				\
	abort ();						\
      }								\
    pass_##ID##_return_value_temp = (RETURN_VALUE);		\
    finalize_pass_##ID PARS;					\
    update_structures (pass_preserves, pass_preserves_all);	\
    pass_preserves_all = __pass_preserves_all;			\
    memcpy (pass_preserves, __pass_preserves, sizeof (__pass_preserves)); \
  }

#define RUN_PASS(ID, PARS)					\
  run_pass_##ID PARS

/* Exported functions.  */
void update_structures		PARAMS ((int [STR_MAX], int));

/* The generated functions.  */
#undef DEF_PASS
#define DEF_PASS(ID, NAME, DESC, PARS, NPARS, HEADER, TYPE, VALUE, INIT, DONE, RUN) \
void initialize_pass_##ID	PARAMS (PARS);			\
void finalize_pass_##ID		PARAMS (PARS);			\
TYPE run_pass_##ID		PARAMS (PARS);
#include "passes.def"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]