[RFC] Toplev.c reorganization

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Thu Feb 6 17:08:00 GMT 2003


Hello,

after discussing it with Honza Hubicka, I have written the following
attempt to reorganize toplev.c. It has the following goals:

1) Make it easier to change order of passes, by building/updating
   automatically the requiered structures and verifying prerequisites.
   The final state should be that any ordering of passes would either
   work or say you why it is impossible.
2) Decrease the number of unnecessary rebuilds of structures, by keeping
   track of those that are up-to-date.
3) Perhaps also make things better organized.

Out of these goals, 1) is surely not fulfilled at all in current state,
and I am very far from reaching it. For 2) you may see the impact on
compilation speed and number of updates of some key structures in
attached results (gcc_rtl is with patch, gcc_rtl_comp without it, both
based on rtlopt-branch).

Any comments are welcome, especially things like "I don't like your evil
macros, you should do it in this clear and elegant way...", or "This
will break things if ULTRA_WEIRD_MACHINE is defined" :-)  (or "Throw
it away, it will never get into mainline while I am alive" -- better
to hear it now while I haven't spent too much time with it).

While the code seems to be in relatively good shape just now (it passes
bootstrap & regtesting on i686), I am not going to commit it to
rtlopt-branch for few following weeks so that it does not interfere
with merge.

Zdenek
-------------- next part --------------
/home/rakdver/gcc/gcc_rtl/gcc/gcc
36.09user 1.42system 0:37.52elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (40269major+45265minor)pagefaults 0swaps
CFG:
  builds: 854
  cleanups: 3416 (854 expensive)

Liveness:
  builds: 854
  updated: 0
    global: 0 (0 targetted, 0 failures)
    local: 0 (0 targetted)


/home/rakdver/gcc/gcc_rtl_comp/gcc/gcc
37.55user 1.37system 0:40.67elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (39252major+45571minor)pagefaults 0swaps
CFG:
  builds: 2562
  cleanups: 4270 (854 expensive)

Liveness:
  builds: 854
  updated: 854
    global: 0 (0 targetted, 0 failures)
    local: 854 (0 targetted)


-------------- next part --------------
/home/rakdver/gcc/gcc_rtl/gcc/gcc
60.12user 1.22system 1:01.46elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (44635major+53707minor)pagefaults 0swaps
CFG:
  builds: 2171
  cleanups: 7522 (7522 expensive)

Liveness:
  builds: 1708
  updated: 3118
    global: 1410 (1410 targetted, 0 failures)
    local: 1708 (0 targetted)


/home/rakdver/gcc/gcc_rtl_comp/gcc/gcc
60.05user 1.68system 1:02.32elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (42918major+53886minor)pagefaults 0swaps
CFG:
  builds: 3416
  cleanups: 8851 (8851 expensive)

Liveness:
  builds: 1708
  updated: 3118
    global: 1410 (1164 targetted, 0 failures)
    local: 1708 (0 targetted)


-------------- next part --------------
/home/rakdver/gcc/gcc_rtl/gcc/gcc
100.39user 1.76system 1:42.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (47195major+62825minor)pagefaults 0swaps
CFG:
  builds: 3025
  cleanups: 16231 (15361 expensive)

Liveness:
  builds: 2562
  updated: 4478
    global: 2217 (2217 targetted, 0 failures)
    local: 2261 (553 targetted)


/home/rakdver/gcc/gcc_rtl_comp/gcc/gcc
101.51user 1.79system 1:43.46elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (45143major+62989minor)pagefaults 0swaps
CFG:
  builds: 4270
  cleanups: 18422 (16714 expensive)

Liveness:
  builds: 2562
  updated: 4779
    global: 2217 (1963 targetted, 0 failures)
    local: 2562 (0 targetted)


-------------- next part --------------
/home/rakdver/gcc/gcc_rtl/gcc/gcc
147.92user 2.02system 2:30.01elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (47667major+69900minor)pagefaults 0swaps
CFG:
  builds: 3036
  cleanups: 17232 (15824 expensive)

Liveness:
  builds: 2556
  updated: 4705
    global: 2434 (2434 targetted, 0 failures)
    local: 2271 (567 targetted)


/home/rakdver/gcc/gcc_rtl_comp/gcc/gcc
150.74user 1.73system 2:32.46elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (45519major+71278minor)pagefaults 0swaps
CFG:
  builds: 4260
  cleanups: 19413 (17709 expensive)

Liveness:
  builds: 2556
  updated: 5842
    global: 2434 (2165 targetted, 0 failures)
    local: 3408 (0 targetted)


-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.937.2.30
diff -c -3 -p -r1.937.2.30 Makefile.in
*** Makefile.in	2 Feb 2003 18:14:57 -0000	1.937.2.30
--- Makefile.in	6 Feb 2003 16:45:05 -0000
*************** C_TREE_H = c-tree.h $(C_COMMON_H)
*** 618,623 ****
--- 618,624 ----
  SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h
  PREDICT_H = predict.h predict.def
  CPPLIB_H = cpplib.h line-map.h
+ PASSES_H = passes.h passes.def structures.def
  
  # sed inserts variable overrides after the following line.
  ####target overrides
*************** C_OBJS = c-parse.o c-lang.o c-pretty-pri
*** 768,774 ****
  
  # 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 loop-unroll.o	   \
   cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o	   \
--- 769,775 ----
  
  # 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 loop-unroll.o	   \
   cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o	   \
*************** prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_
*** 1402,1407 ****
--- 1403,1413 ----
  convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \
     convert.h toplev.h langhooks.h
  
+ passes.o: passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+    $(PASSES_H) $(RTL_H) $(REGS_H) $(BASIC_BLOCK_H) except.h output.h \
+    toplev.h $(TIMEVAR_H) ssa.h cfgloop.h gcse-globals.h flags.h vpt.h \
+    $(GGC_H) reload.h insn-config.h integrate.h $(RECOG_H)
+ 
  langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
     tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
     $(LANGHOOKS_DEF_H) flags.h
*************** diagnostic.o : diagnostic.c diagnostic.h
*** 1427,1433 ****
     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) vpt.h \
--- 1433,1439 ----
     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 $(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) vpt.h \
*************** except.o : except.c $(CONFIG_H) $(SYSTEM
*** 1468,1474 ****
     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) $(TIMEVAR_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
*** 1535,1541 ****
     function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_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 
  gcse-utils.o : gcse-utils.c $(CONFIG_H) $(SYSTEM_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) \
--- 1541,1548 ----
     function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_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 \
!    $(PASSES_H) $(TIMEVAR_H)
  gcse-utils.o : gcse-utils.c $(CONFIG_H) $(SYSTEM_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) \
*************** gcse-store.o : gcse-store.c $(CONFIG_H) 
*** 1565,1577 ****
     $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \
     except.h gcse-globals.h gcse-utils.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 \
     $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
     $(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
--- 1572,1585 ----
     $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \
     except.h gcse-globals.h gcse-utils.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) \
!    $(PASSES_H) $(TIMEVAR_H)
  resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \
     $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
     $(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) $(TIMEVAR_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
*************** profile.o : profile.c $(CONFIG_H) $(SYST
*** 1592,1604 ****
     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) \
!    params.h  vpt.h
  vpt.o : vpt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) profile.h \
     hard-reg-set.h vpt.h $(EXPR_H) output.h $(TM_H)
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
     insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
     real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
!    toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H)
  doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \
     cfgloop.h
--- 1600,1613 ----
     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) \
!    params.h vpt.h $(PASSES_H) $(TIMEVAR_H)
  vpt.o : vpt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) profile.h \
     hard-reg-set.h vpt.h $(EXPR_H) output.h $(TM_H)
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
     insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
     real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
!    toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(TIMEVAR_H) \
!    $(PASSES_H)
  doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \
     cfgloop.h
*************** unroll.o : unroll.c $(CONFIG_H) $(SYSTEM
*** 1609,1621 ****
  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
  cfgrtl.o : cfgrtl.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) insn-config.h
  cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
  cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
--- 1618,1630 ----
  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 $(TIMEVAR_H)
  cfgrtl.o : cfgrtl.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) insn-config.h $(PASSES_H) $(TIMEVAR_H)
  cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
  cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
*************** cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SY
*** 1623,1629 ****
     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) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
  cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
--- 1632,1638 ----
     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) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
  cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
*************** cfgloopanal.o : cfgloopanal.c $(CONFIG_H
*** 1631,1637 ****
  cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h output.h
  loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) gcov-io.h \
!    gcov-iov.h $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h profile.h
  loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h params.h \
     output.h $(expr.h)
--- 1640,1647 ----
  cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h output.h
  loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) gcov-io.h \
!    gcov-iov.h $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h profile.h \
!    $(PASSES_H) toplev.h $(TIMEVAR_H) flags.h
  loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
     $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h params.h \
     output.h $(expr.h)
*************** dominance.o : dominance.c $(CONFIG_H) $(
*** 1643,1665 ****
  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 \
     real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
  local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
!    output.h function.h $(INSN_ATTR_H) toplev.h  except.h $(TM_P_H)
  bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H)  coretypes.h $(GTM_H) $(RTL_H) flags.h \
     $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
  	$(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
--- 1653,1678 ----
  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) \
!    $(PASSES_H) $(TIMEVAR_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 \
     real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
  local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
!    output.h function.h $(INSN_ATTR_H) toplev.h  except.h $(TM_P_H) \
!    $(TIMEVAR_H) $(PASSES_H)
  bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H)  coretypes.h $(GTM_H) $(RTL_H) flags.h \
     $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
  	$(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) $(TIMEVAR_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) \
!    $(TIMEVAR_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
*************** reload.o : reload.c $(CONFIG_H) $(SYSTEM
*** 1677,1683 ****
  reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
     $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
     $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
!    except.h $(TREE_H)
  caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
     $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
--- 1690,1696 ----
  reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
     $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
     $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
!    except.h $(TREE_H) $(TIMEVAR_H) $(PASSES_H)
  caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
     $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
*************** reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H
*** 1687,1699 ****
  alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
     $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
!    gt-alias.h
  regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
     $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
     $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
  haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
!    $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
  sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
     $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H)
--- 1700,1713 ----
  alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
     $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
!    gt-alias.h $(PASSES_H) $(TIMEVAR_H)
  regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
     $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
     $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
  haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
!    $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) \
!    $(TIMEVAR_H) $(PASSES_H)
  sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
     sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
     $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H)
*************** final.o : final.c $(CONFIG_H) $(SYSTEM_H
*** 1713,1722 ****
     $(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 \
--- 1727,1736 ----
     $(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) $(TIMEVAR_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) $(TIMEVAR_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 \
*************** timevar.o : timevar.c $(CONFIG_H) $(SYST
*** 1740,1749 ****
     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)
  
--- 1754,1763 ----
     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) $(TIMEVAR_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) $(TIMEVAR_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: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.178.2.7
diff -c -3 -p -r1.178.2.7 alias.c
*** alias.c	23 Jan 2003 21:28:39 -0000	1.178.2.7
--- alias.c	6 Feb 2003 16:45:05 -0000
*************** Software Foundation, 59 Temple Place - S
*** 40,45 ****
--- 40,47 ----
  #include "ggc.h"
  #include "langhooks.h"
  #include "target.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* The alias sets assigned to MEMs assist the back-end in determining
     which MEMs can alias which other MEMs.  In general, two MEMs in
*************** mark_constant_function ()
*** 2643,2649 ****
  
    nonlocal_memory_referenced = 0;
  
!   init_alias_analysis ();
  
    /* Determine if this is a constant or pure function.  */
  
--- 2645,2651 ----
  
    nonlocal_memory_referenced = 0;
  
!   REQ_STRUCTURE (alias_info, OK);
  
    /* Determine if this is a constant or pure function.  */
  
*************** mark_constant_function ()
*** 2659,2666 ****
        if (! nonlocal_memory_referenced)
  	nonlocal_memory_referenced = nonlocal_referenced_p (insn);
      }
- 
-   end_alias_analysis ();
  
    /* Mark the function.  */
  
--- 2661,2666 ----
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.158.2.8
diff -c -3 -p -r1.158.2.8 basic-block.h
*** basic-block.h	23 Jan 2003 21:28:39 -0000	1.158.2.8
--- basic-block.h	6 Feb 2003 16:45:05 -0000
*************** extern void dump_edge_info		PARAMS ((FIL
*** 376,381 ****
--- 376,385 ----
  extern void clear_edges			PARAMS ((void));
  extern void mark_critical_edges		PARAMS ((void));
  extern rtx first_insn_after_basic_block_note	PARAMS ((basic_block));
+ extern bool cfg_cleanup_unnecessary_p	PARAMS ((int));
+ 
+ /* Flags of the last cfg_cleanup.  */
+ extern int last_cfg_cleanup_flags;
  
  /* Dominator information for basic blocks.  */
  
*************** extern bool probably_never_executed_bb_p
*** 541,547 ****
  
  /* 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));
--- 545,551 ----
  
  /* 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.50.2.23
diff -c -3 -p -r1.50.2.23 bb-reorder.c
*** bb-reorder.c	23 Jan 2003 09:08:53 -0000	1.50.2.23
--- bb-reorder.c	6 Feb 2003 16:45:05 -0000
*************** get_uncond_jump_length ()
*** 1068,1084 ****
  
  /* Reorder basic blocks.  The main entry point to this file.  */
  
! void
  reorder_basic_blocks ()
  {
    int n_traces;
    struct trace *traces;
  
    if (n_basic_blocks <= 1)
!     return;
  
    if ((* targetm.cannot_modify_jumps_p) ())
!     return;
  
    cfg_layout_initialize (NULL);
  
--- 1068,1084 ----
  
  /* Reorder basic blocks.  The main entry point to this file.  */
  
! bool
  reorder_basic_blocks ()
  {
    int n_traces;
    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 ()
*** 1096,1099 ****
--- 1096,1100 ----
      dump_flow_info (rtl_dump_file);
  
    cfg_layout_finalize ();
+   return true;
  }
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.35.2.5
diff -c -3 -p -r1.35.2.5 cfg.c
*** cfg.c	23 Jan 2003 21:28:40 -0000	1.35.2.5
--- cfg.c	6 Feb 2003 16:45:05 -0000
*************** Software Foundation, 59 Temple Place - S
*** 58,63 ****
--- 58,64 ----
  #include "tm_p.h"
  #include "obstack.h"
  #include "alloc-pool.h"
+ #include "timevar.h"
  
  /* The obstack on which the flow graph components are allocated.  */
  
*************** dump_flow_info (file)
*** 490,495 ****
--- 491,498 ----
    basic_block bb;
    static const char * const reg_class_names[] = REG_CLASS_NAMES;
  
+   timevar_push (TV_DUMP);
+ 
    fprintf (file, "%d registers.\n", max_regno);
    for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
      if (REG_N_REFS (i))
*************** dump_flow_info (file)
*** 603,608 ****
--- 606,612 ----
      }
  
    putc ('\n', file);
+   timevar_pop (TV_DUMP);
  }
  
  void
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.63.2.9
diff -c -3 -p -r1.63.2.9 cfgcleanup.c
*** cfgcleanup.c	28 Jan 2003 22:47:45 -0000	1.63.2.9
--- cfgcleanup.c	6 Feb 2003 16:45:05 -0000
*************** Software Foundation, 59 Temple Place - S
*** 47,52 ****
--- 47,56 ----
  #include "cselib.h"
  #include "tm_p.h"
  #include "target.h"
+ #include "passes.h"
+ 
+ /* Flags of last cfg cleanup.  */
+ int last_cfg_cleanup_flags;
  
  /* cleanup_cfg maintains following flags for each basic block.  */
  
*************** delete_unreachable_blocks ()
*** 1815,1820 ****
--- 1819,1894 ----
    return changed;
  }
  
+ /* Check whether the proposed cfg cleanup is not redundant.  */
+ bool
+ cfg_cleanup_unnecessary_p (flags)
+      int flags;
+ {
+   /* If anything changed, just run the pass.  */
+   if (STATE_OF_STRUCTURE (nothing_changed_since_last_cfg_cleanup) != SS_OK)
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, something has changed\n");
+       return false;
+     }
+   
+   /* If we have some of these flags on we haven't previously, run the pass.  */
+   if ((flags & CLEANUP_EXPENSIVE) && !(last_cfg_cleanup_flags & CLEANUP_EXPENSIVE))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, expensive added\n");
+       return false;
+     }
+   if ((flags & CLEANUP_CROSSJUMP) && !(last_cfg_cleanup_flags & CLEANUP_CROSSJUMP))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, crossjumping added\n");
+       return false;
+     }
+   if ((flags & CLEANUP_UPDATE_LIFE) && !(last_cfg_cleanup_flags & CLEANUP_UPDATE_LIFE))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, update_life added\n");
+       return false;
+     }
+   if ((flags & CLEANUP_THREADING) && !(last_cfg_cleanup_flags & CLEANUP_THREADING))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, threading added\n");
+       return false;
+     }
+ 
+   /* If we were restrained by this previously and we aren't now, run the pass.  */
+   if (!(flags & CLEANUP_POST_REGSTACK) && (last_cfg_cleanup_flags & CLEANUP_POST_REGSTACK))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, post_regstack removed\n");
+       return false;
+     }
+   if (!(flags & CLEANUP_PRE_SIBCALL) && (last_cfg_cleanup_flags & CLEANUP_PRE_SIBCALL))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, pre_sibcall removed\n");
+       return false;
+     }
+   if (!(flags & CLEANUP_PRE_LOOP) && (last_cfg_cleanup_flags & CLEANUP_PRE_LOOP))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, pre_loop removed\n");
+       return false;
+     }
+   if (!(flags & CLEANUP_NO_INSN_DEL) && (last_cfg_cleanup_flags & CLEANUP_NO_INSN_DEL))
+     {
+       if (dump_structure_manipulations)
+ 	fprintf (stderr, "cleanup neccessary, no_insn_del removed\n");
+       return false;
+     }
+ 
+   if (dump_structure_manipulations)
+     fprintf (stderr, "cleanup unneccessary\n");
+   return true;
+ }
+ 
  /* Tidy the CFG by deleting unreachable code and whatnot.  */
  
  bool
*************** cleanup_cfg (mode)
*** 1827,1834 ****
    if (mode & (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_THREADING))
      cfg_expensive_cleanups++;
  
!   timevar_push (TV_CLEANUP_CFG);
!   if (delete_unreachable_blocks ())
      {
        changed = true;
        /* We've possibly created trivially dead code.  Cleanup it right
--- 1901,1907 ----
    if (mode & (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_THREADING))
      cfg_expensive_cleanups++;
  
!   if (RUN_PASS (delete_unreachable_blocks, ()))
      {
        changed = true;
        /* We've possibly created trivially dead code.  Cleanup it right
*************** cleanup_cfg (mode)
*** 1836,1874 ****
        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))
  	    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.  */
    free_EXPR_LIST_list (&label_value_list);
-   timevar_pop (TV_CLEANUP_CFG);
  
    return changed;
  }
--- 1909,1944 ----
        if (!(mode & (CLEANUP_NO_INSN_DEL
  		    | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
  	  && !reload_completed)
! 	RUN_PASS (trivial_dce, ());
      }
  
    compact_blocks ();
  
    while (try_optimize_cfg (mode))
      {
!       RUN_PASS (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 (!RUN_PASS (dce, ()))
  	    break;
  	}
        else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
  	       && !reload_completed)
  	{
! 	  if (!RUN_PASS (trivial_dce, ()))
  	    break;
  	}
        else
  	break;
!       RUN_PASS (delete_dead_jumptables, ());
      }
  
    /* Kill the data we won't maintain.  */
    free_EXPR_LIST_list (&label_value_list);
  
    return changed;
  }
Index: cfgloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.15.4.7
diff -c -3 -p -r1.15.4.7 cfgloop.c
*** cfgloop.c	16 Jan 2003 00:06:59 -0000	1.15.4.7
--- cfgloop.c	6 Feb 2003 16:45:05 -0000
*************** Software Foundation, 59 Temple Place - S
*** 33,38 ****
--- 33,41 ----
     considered to belong to inner loop with same header.  */
  #define HEAVY_EDGE_RATIO 8
  
+ /* The datastructure itself.  */
+ struct loops loop_tree;
+ 
  static void flow_loops_cfg_dump		PARAMS ((const struct loops *,
  						 FILE *));
  static void flow_loop_entry_edges_find	PARAMS ((struct loop *));
*************** flow_loops_free (loops)
*** 262,268 ****
  	free (loops->cfg.dfs_order);
        if (loops->cfg.rc_order)
  	free (loops->cfg.rc_order);
- 
      }
  }
  
--- 265,270 ----
Index: cfgloop.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.h,v
retrieving revision 1.1.2.7
diff -c -3 -p -r1.1.2.7 cfgloop.h
*** cfgloop.h	19 Dec 2002 21:29:38 -0000	1.1.2.7
--- cfgloop.h	6 Feb 2003 16:45:05 -0000
*************** struct loops
*** 257,262 ****
--- 257,265 ----
    int state;
  };
  
+ /* The datastructure itself.  */
+ extern struct loops loop_tree;
+ 
  /* Flags for loop discovery.  */
  
  #define LOOP_TREE		1	/* Build loop hierarchy tree.  */
*************** extern edge split_loop_bb		PARAMS ((stru
*** 350,359 ****
  
  /* Loop optimizer initialization.  */
  extern struct loops *loop_optimizer_init PARAMS ((FILE *));
! extern void loop_optimizer_finalize	PARAMS ((struct loops *, FILE *));
  
  /* Optimization passes.  */
! extern void unswitch_loops		PARAMS ((struct loops *));
  
  enum
  {
--- 353,362 ----
  
  /* Loop optimizer initialization.  */
  extern struct loops *loop_optimizer_init PARAMS ((FILE *));
! extern void loop_optimizer_finalize	PARAMS ((FILE *));
  
  /* Optimization passes.  */
! extern bool unswitch_loops		PARAMS ((struct loops *));
  
  enum
  {
*************** enum
*** 362,366 ****
    UAP_UNROLL_ALL = 4
  };
  
! extern void unroll_and_peel_loops	PARAMS ((struct loops *, int));
  
--- 365,369 ----
    UAP_UNROLL_ALL = 4
  };
  
! extern bool unroll_and_peel_loops	PARAMS ((struct loops *, int));
  
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.58.4.7
diff -c -3 -p -r1.58.4.7 cfgrtl.c
*** cfgrtl.c	23 Jan 2003 21:28:41 -0000	1.58.4.7
--- cfgrtl.c	6 Feb 2003 16:45:05 -0000
*************** Software Foundation, 59 Temple Place - S
*** 59,64 ****
--- 59,66 ----
  #include "tm_p.h"
  #include "obstack.h"
  #include "insn-config.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* Stubs in case we don't have a return insn.  */
  #ifndef HAVE_return
*************** purge_all_dead_edges (update_life_p)
*** 2290,2319 ****
       int update_life_p;
  {
    int purged = false;
-   sbitmap blocks = 0;
    basic_block bb;
  
-   if (update_life_p)
-     {
-       blocks = sbitmap_alloc (last_basic_block);
-       sbitmap_zero (blocks);
-     }
- 
    FOR_EACH_BB (bb)
!     {
!       bool purged_here = purge_dead_edges (bb);
! 
!       purged |= purged_here;
!       if (purged_here && update_life_p)
! 	SET_BIT (blocks, bb->index);
!     }
  
    if (update_life_p && purged)
!     update_life_info (blocks, UPDATE_LIFE_GLOBAL,
! 		      PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
! 		      | PROP_KILL_DEAD_CODE);
  
-   if (update_life_p)
-     sbitmap_free (blocks);
    return purged;
  }
--- 2292,2304 ----
       int update_life_p;
  {
    int purged = false;
    basic_block bb;
  
    FOR_EACH_BB (bb)
!     purged |= purge_dead_edges (bb);
  
    if (update_life_p && purged)
!     RUN_PASS (dce, ());
  
    return purged;
  }
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.310.2.9
diff -c -3 -p -r1.310.2.9 combine.c
*** combine.c	23 Jan 2003 21:28:41 -0000	1.310.2.9
--- combine.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 92,97 ****
--- 92,99 ----
  #include "recog.h"
  #include "real.h"
  #include "toplev.h"
+ #include "timevar.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)
*** 733,743 ****
    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);
--- 735,743 ----
    EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i,
  			     BASIC_BLOCK (i)->flags |= BB_DIRTY);
    new_direct_jump_p |= purge_all_dead_edges (0);
!   RUN_PASS (delete_noop_moves, ());
!   
!   RUN_PASS (dce, ());
  
    /* Clean up.  */
    sbitmap_free (refresh_blocks);
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.231.2.7
diff -c -3 -p -r1.231.2.7 cse.c
*** cse.c	23 Jan 2003 21:28:45 -0000	1.231.2.7
--- cse.c	6 Feb 2003 16:45:06 -0000
*************** cse_main (f, nregs, after_loop, file)
*** 7103,7109 ****
    val.path_size = 0;
  
    init_recog ();
-   init_alias_analysis ();
  
    max_reg = nregs;
  
--- 7103,7108 ----
*************** cse_main (f, nregs, after_loop, file)
*** 7217,7223 ****
      max_elements_made = n_elements_made;
  
    /* Clean up.  */
-   end_alias_analysis ();
    free (uid_cuid);
    free (reg_eqv_table);
  
--- 7216,7221 ----
*************** delete_trivially_dead_insns (insns, nreg
*** 7684,7690 ****
    int in_libcall = 0, dead_libcall = 0;
    int ndead = 0, nlastdead, niterations = 0;
  
-   timevar_push (TV_DELETE_TRIVIALLY_DEAD);
    /* First count the number of times each register is used.  */
    counts = (int *) xcalloc (nreg, sizeof (int));
    for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
--- 7682,7687 ----
*************** delete_trivially_dead_insns (insns, nreg
*** 7751,7756 ****
  	     ndead, niterations);
    /* Clean up.  */
    free (counts);
-   timevar_pop (TV_DELETE_TRIVIALLY_DEAD);
    return ndead;
  }
--- 7748,7752 ----
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.228.2.3
diff -c -3 -p -r1.228.2.3 except.c
*** except.c	23 Jan 2003 21:28:46 -0000	1.228.2.3
--- except.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 73,78 ****
--- 73,80 ----
  #include "tm_p.h"
  #include "target.h"
  #include "langhooks.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* Provide defaults for stuff that may not be defined when using
     sjlj exceptions.  */
*************** 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.  */
  
!   RUN_PASS (cfg_cleanup, (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL, 0));
  
    /* These registers are used by the landing pads.  Make sure they
       have been generated.  */
*************** finish_eh_generation ()
*** 2285,2295 ****
  
    cfun->eh->built_landing_pads = 1;
  
!   /* 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
--- 2287,2293 ----
  
    cfun->eh->built_landing_pads = 1;
  
!   return true;
  }
  
  static hashval_t
Index: except.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.h,v
retrieving revision 1.64.6.1
diff -c -3 -p -r1.64.6.1 except.h
*** except.h	16 Oct 2002 16:07:16 -0000	1.64.6.1
--- except.h	6 Feb 2003 16:45:06 -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.88.2.10
diff -c -3 -p -r1.88.2.10 flags.h
*** flags.h	25 Jan 2003 11:45:38 -0000	1.88.2.10
--- flags.h	6 Feb 2003 16:45:06 -0000
*************** extern int flag_zero_initialized_in_bss;
*** 682,687 ****
--- 682,693 ----
  /* Nonzero means disable transformations observable by signaling NaNs.  */
  extern int flag_signaling_nans;
  
+ /* Print structure computation & usage statistics.  */
+ extern int structure_statistics;
+ 
+ /* Dump actions performed on structures to stderr.  */
+ extern int dump_structure_manipulations;
+ 
  /* True if the given mode has a NaN representation and the treatment of
     NaN operands is important.  Certain optimizations, such as folding
     x * 0 into x, are not correct for NaN operands, and are normally
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.536.2.8
diff -c -3 -p -r1.536.2.8 flow.c
*** flow.c	28 Jan 2003 22:47:45 -0000	1.536.2.8
--- flow.c	6 Feb 2003 16:45:06 -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"
*************** first_insn_after_basic_block_note (block
*** 417,423 ****
  void
  life_analysis (f, file, flags)
       rtx f;
!      FILE *file;
       int flags;
  {
  #ifdef ELIMINABLE_REGS
--- 418,424 ----
  void
  life_analysis (f, file, flags)
       rtx f;
!      FILE *file ATTRIBUTE_UNUSED;
       int flags;
  {
  #ifdef ELIMINABLE_REGS
*************** life_analysis (f, file, flags)
*** 442,448 ****
    SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
  #endif
  
- 
  #ifdef CANNOT_CHANGE_MODE_CLASS
    if (flags & PROP_REG_INFO)
      {
--- 443,448 ----
*************** life_analysis (f, file, flags)
*** 452,481 ****
      }
  #endif
  
-   if (! optimize)
-     flags &= ~(PROP_LOG_LINKS | PROP_AUTOINC | PROP_ALLOW_CFG_CHANGES);
- 
-   /* The post-reload life analysis have (on a global basis) the same
-      registers live as was computed by reload itself.  elimination
-      Otherwise offsets and such may be incorrect.
- 
-      Reload will make some registers as live even though they do not
-      appear in the rtl.
- 
-      We don't want to create new auto-incs after reload, since they
-      are unlikely to be useful and can cause problems with shared
-      stack slots.  */
-   if (reload_completed)
-     flags &= ~(PROP_REG_INFO | PROP_AUTOINC);
- 
-   /* We want alias analysis information for local dead store elimination.  */
-   if (optimize && (flags & PROP_SCAN_DEAD_STORES))
-     init_alias_analysis ();
- 
-   /* 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,
       we've already emitted the epilogue so there's no sense searching.  */
--- 452,457 ----
*************** life_analysis (f, file, flags)
*** 497,514 ****
    if (flags & PROP_REG_INFO)
      memset (regs_ever_live, 0, sizeof (regs_ever_live));
    update_life_info (NULL, UPDATE_LIFE_GLOBAL, flags);
- 
-   /* Clean up.  */
-   if (optimize && (flags & PROP_SCAN_DEAD_STORES))
-     end_alias_analysis ();
- 
-   if (file)
-     dump_flow_info (file);
- 
-   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.
--- 473,478 ----
*************** update_life_info (blocks, extent, prop_f
*** 715,721 ****
  	     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);
  	}
  
        /* If asked, remove notes from the blocks we'll update.  */
--- 679,686 ----
  	     instructions deleted above, that might have been only a
  	     partial improvement (see MAX_MEM_SET_LIST_LEN usage).
  	     Further improvement may be possible.  */
! 	  FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
  	}
  
        /* If asked, remove notes from the blocks we'll update.  */
*************** delete_noop_moves (f)
*** 892,901 ****
     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);
--- 857,868 ----
     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 retval = false;
+ 
    for (insn = get_insns (); insn; insn = next)
      {
        next = NEXT_INSN (insn);
*************** delete_dead_jumptables ()
*** 909,917 ****
--- 876,887 ----
  	    fprintf (rtl_dump_file, "Dead jumptable %i removed\n", INSN_UID (insn));
  	  delete_insn (NEXT_INSN (insn));
  	  delete_insn (insn);
+ 	  retval = true;
  	  next = NEXT_INSN (next);
  	}
      }
+ 
+   return retval;
  }
  
  /* Determine if the stack pointer is constant over the life of the function.
*************** debug_regset (r)
*** 4370,4388 ****
     register allocators to prioritize pseudos for allocation to hard regs.
     More accurate reference counts generally lead to better register allocation.
  
-    F is the first insn to be scanned.
- 
-    LOOP_STEP denotes how much loop_depth should be incremented per
-    loop nesting level in order to increase the ref count more for
-    references in a loop.
- 
     It might be worthwhile to update REG_LIVE_LENGTH, REG_BASIC_BLOCK and
     possibly other information which is used by the register allocators.  */
  
  void
! recompute_reg_usage (f, loop_step)
!      rtx f ATTRIBUTE_UNUSED;
!      int loop_step ATTRIBUTE_UNUSED;
  {
    allocate_reg_life_data ();
    update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO);
--- 4340,4350 ----
     register allocators to prioritize pseudos for allocation to hard regs.
     More accurate reference counts generally lead to better register allocation.
  
     It might be worthwhile to update REG_LIVE_LENGTH, REG_BASIC_BLOCK and
     possibly other information which is used by the register allocators.  */
  
  void
! recompute_reg_usage ()
  {
    allocate_reg_life_data ();
    update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO);
Index: gcse-store.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gcse-store.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 gcse-store.c
*** gcse-store.c	8 Dec 2002 14:36:25 -0000	1.1.2.2
--- gcse-store.c	6 Feb 2003 16:45:06 -0000
*************** store_motion ()
*** 693,700 ****
        print_rtl (gcse_file, get_insns ());
      }
  
-   init_alias_analysis ();
- 
    /* Find all the stores that are live to the end of their block.  */
    store_data.num_stores = compute_store_table (&store_data);
    if (store_data.num_stores == 0)
--- 693,698 ----
*************** store_motion ()
*** 732,736 ****
    free_store_memory (&store_data);
    free_edge_list (store_data.edge_list);
    remove_fake_edges ();
-   end_alias_analysis ();
  }
--- 730,733 ----
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.218.2.6
diff -c -3 -p -r1.218.2.6 gcse.c
*** gcse.c	23 Jan 2003 21:28:48 -0000	1.218.2.6
--- gcse.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 165,170 ****
--- 165,172 ----
  #include "ggc.h"
  #include "params.h"
  #include "cselib.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  #include "obstack.h"
  
*************** gcse_main (f, file)
*** 449,455 ****
    bytes_used = 0;
  
    /* We need alias.  */
!   init_alias_analysis ();
    /* Record where pseudo-registers are set.  This data is kept accurate
       during each pass.  ??? We could also record hard-reg information here
       [since it's unchanging], however it is currently done during hash table
--- 451,458 ----
    bytes_used = 0;
  
    /* We need alias.  */
!   REQ_STRUCTURE (alias_info, OK);
! 
    /* Record where pseudo-registers are set.  This data is kept accurate
       during each pass.  ??? We could also record hard-reg information here
       [since it's unchanging], however it is currently done during hash table
*************** gcse_main (f, file)
*** 564,571 ****
  
    obstack_free (&gcse_obstack, NULL);
    free_reg_set_mem ();
-   /* We are finished with alias.  */
-   end_alias_analysis ();
    allocate_reg_info (max_reg_num (), FALSE, FALSE);
  
    /* Store motion disabled until it is fixed.  */
--- 567,572 ----
*************** bypass_jumps (file)
*** 726,732 ****
    bytes_used = 0;
  
    /* We need alias.  */
!   init_alias_analysis ();
  
    /* Record where pseudo-registers are set.  This data is kept accurate
       during each pass.  ??? We could also record hard-reg information here
--- 727,733 ----
    bytes_used = 0;
  
    /* We need alias.  */
!   REQ_STRUCTURE (alias_info, OK);
  
    /* Record where pseudo-registers are set.  This data is kept accurate
       during each pass.  ??? We could also record hard-reg information here
*************** bypass_jumps (file)
*** 755,762 ****
    obstack_free (&gcse_obstack, NULL);
    free_reg_set_mem ();
  
-   /* We are finished with alias.  */
-   end_alias_analysis ();
    allocate_reg_info (max_reg_num (), FALSE, FALSE);
  
    return changed;
--- 756,761 ----
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.84.2.4
diff -c -3 -p -r1.84.2.4 global.c
*** global.c	23 Jan 2003 21:28:50 -0000	1.84.2.4
--- global.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 37,42 ****
--- 37,44 ----
  #include "reload.h"
  #include "output.h"
  #include "toplev.h"
+ #include "timevar.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)
*** 576,589 ****
    /* Do the reloads now while the allocno data still exist, so that we can
       try to assign new hard regs to any pseudo regs that are spilled.  */
  
! #if 0 /* We need to eliminate regs even if there is no rtl code,
! 	 for the sake of debugging information.  */
!   if (n_basic_blocks > 0)
! #endif
!     {
!       build_insn_chain (get_insns ());
!       retval = reload (get_insns (), 1);
!     }
  
    /* Clean up.  */
    free (reg_allocno);
--- 578,584 ----
    /* Do the reloads now while the allocno data still exist, so that we can
       try to assign new hard regs to any pseudo regs that are spilled.  */
  
!   retval = RUN_PASS (reload, (1));
  
    /* Clean up.  */
    free (reg_allocno);
*************** dump_global_regs (file)
*** 1956,1961 ****
--- 1951,1958 ----
  {
    int i, j;
  
+   timevar_push (TV_DUMP);
+ 
    fprintf (file, ";; Register dispositions:\n");
    for (i = FIRST_PSEUDO_REGISTER, j = 0; i < max_regno; i++)
      if (reg_renumber[i] >= 0)
*************** dump_global_regs (file)
*** 1970,1973 ****
--- 1967,1972 ----
      if (regs_ever_live[i])
        fprintf (file, " %d", i);
    fprintf (file, "\n\n");
+   
+   timevar_pop (TV_DUMP);
  }
Index: haifa-sched.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/haifa-sched.c,v
retrieving revision 1.211.2.6
diff -c -3 -p -r1.211.2.6 haifa-sched.c
*** haifa-sched.c	23 Jan 2003 21:28:50 -0000	1.211.2.6
--- haifa-sched.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 151,156 ****
--- 151,158 ----
  #include "recog.h"
  #include "sched-int.h"
  #include "target.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  #ifdef INSN_SCHEDULING
  
*************** sched_init (dump_file)
*** 2482,2488 ****
  
    init_dependency_caches (luid);
  
!   init_alias_analysis ();
  
    if (write_symbols != NO_DEBUG)
      {
--- 2484,2490 ----
  
    init_dependency_caches (luid);
  
!   REQ_STRUCTURE (alias_info, OK);
  
    if (write_symbols != NO_DEBUG)
      {
*************** sched_finish ()
*** 2557,2563 ****
        dfa_finish ();
      }
    free_dependency_caches ();
-   end_alias_analysis ();
    if (write_symbols != NO_DEBUG)
      free (line_note_head);
  }
--- 2559,2564 ----
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.102.2.5
diff -c -3 -p -r1.102.2.5 ifcvt.c
*** ifcvt.c	25 Jan 2003 11:45:39 -0000	1.102.2.5
--- ifcvt.c	6 Feb 2003 16:45:06 -0000
***************
*** 37,42 ****
--- 37,44 ----
  #include "output.h"
  #include "toplev.h"
  #include "tm_p.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  
  #ifndef HAVE_conditional_execution
*************** dead_or_predicable (test_bb, merge_bb, o
*** 3102,3123 ****
  
  /* Main entry point for all if-conversion.  */
  
! void
  if_convert (x_life_data_ok)
       int x_life_data_ok;
  {
    basic_block bb;
    int pass;
  
    num_possible_if_blocks = 0;
    num_updated_if_blocks = 0;
    num_removed_blocks = 0;
    life_data_ok = (x_life_data_ok != 0);
  
-   /* Free up basic_block_for_insn so that we don't have to keep it
-      up to date, either here or in merge_blocks_nomove.  */
-   free_basic_block_vars (1);
- 
    /* Compute postdominators if we think we'll use them.  */
    post_dominators = NULL;
    if (HAVE_conditional_execution || life_data_ok)
--- 3104,3122 ----
  
  /* Main entry point for all if-conversion.  */
  
! bool
  if_convert (x_life_data_ok)
       int x_life_data_ok;
  {
    basic_block bb;
    int pass;
+   bool changed = false;
  
    num_possible_if_blocks = 0;
    num_updated_if_blocks = 0;
    num_removed_blocks = 0;
    life_data_ok = (x_life_data_ok != 0);
  
    /* Compute postdominators if we think we'll use them.  */
    post_dominators = NULL;
    if (HAVE_conditional_execution || life_data_ok)
*************** if_convert (x_life_data_ok)
*** 3145,3151 ****
  	{
  	  basic_block new_bb;
  	  while ((new_bb = find_if_header (bb, pass)))
! 	    bb = new_bb;
  	}
  
  #ifdef IFCVT_MULTIPLE_DUMPS
--- 3144,3153 ----
  	{
  	  basic_block new_bb;
  	  while ((new_bb = find_if_header (bb, pass)))
! 	    {
! 	      changed = true;
! 	      bb = new_bb;
! 	    }
  	}
  
  #ifdef IFCVT_MULTIPLE_DUMPS
*************** 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.  */
--- 3179,3185 ----
  	  max_regno = max_reg_num ();
  	  allocate_reg_info (max_regno, FALSE, FALSE);
  	}
!       RUN_PASS (dce, ());
      }
  
    /* Write the final stats.  */
*************** if_convert (x_life_data_ok)
*** 3199,3202 ****
--- 3199,3204 ----
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
+ 
+   return changed;
  }
Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.210.6.5
diff -c -3 -p -r1.210.6.5 jump.c
*** jump.c	11 Jan 2003 15:34:12 -0000	1.210.6.5
--- jump.c	6 Feb 2003 16:45:06 -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.50.6.2
diff -c -3 -p -r1.50.6.2 lcm.c
*** lcm.c	23 Jan 2003 21:28:50 -0000	1.50.6.2
--- lcm.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 63,68 ****
--- 63,70 ----
  #include "basic-block.h"
  #include "output.h"
  #include "tm_p.h"
+ #include "timevar.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;
--- 1337,1344 ----
      commit_edge_insertions ();
  
  #ifdef NORMAL_MODE
!   FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
!   RUN_PASS (cfg_cleanup, (CLEANUP_NO_INSN_DEL, 0));
  #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;
  }
--- 1346,1352 ----
  
    max_regno = max_reg_num ();
    allocate_reg_info (max_regno, FALSE, FALSE);
!   RUN_PASS (dce, ());
  
    return 1;
  }
Index: local-alloc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/local-alloc.c,v
retrieving revision 1.110.2.5
diff -c -3 -p -r1.110.2.5 local-alloc.c
*** local-alloc.c	23 Jan 2003 21:28:50 -0000	1.110.2.5
--- local-alloc.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 77,82 ****
--- 77,84 ----
  #include "toplev.h"
  #include "except.h"
  #include "integrate.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* Next quantity number available for allocation.  */
  
*************** update_equiv_regs ()
*** 819,825 ****
    reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv);
    INIT_REG_SET (&cleared_regs);
  
!   init_alias_analysis ();
  
    /* Scan the insns and find which registers have equivalences.  Do this
       in a separate scan of the insns because (due to -fcse-follow-jumps)
--- 821,827 ----
    reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv);
    INIT_REG_SET (&cleared_regs);
  
!   REQ_STRUCTURE (alias_info, OK);
  
    /* Scan the insns and find which registers have equivalences.  Do this
       in a separate scan of the insns because (due to -fcse-follow-jumps)
*************** update_equiv_regs ()
*** 1173,1179 ****
      }
  
    /* Clean up.  */
-   end_alias_analysis ();
    CLEAR_REG_SET (&cleared_regs);
    free (reg_equiv);
  }
--- 1175,1180 ----
*************** dump_local_alloc (file)
*** 2487,2493 ****
--- 2488,2497 ----
       FILE *file;
  {
    int i;
+ 
+   timevar_push (TV_DUMP);
    for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
      if (reg_renumber[i] != -1)
        fprintf (file, ";; Register %d in %d.\n", i, reg_renumber[i]);
+   timevar_pop (TV_DUMP);
  }
Index: loop-init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/loop-init.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 loop-init.c
*** loop-init.c	19 Dec 2002 21:29:38 -0000	1.1.2.6
--- loop-init.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 30,35 ****
--- 30,39 ----
  #include "cfglayout.h"
  #include "gcov-io.h"
  #include "profile.h"
+ #include "toplev.h"
+ #include "timevar.h"
+ #include "flags.h"
+ #include "passes.h"
  
  /* Initialize loop optimizer.  */
  
*************** struct loops *
*** 37,43 ****
  loop_optimizer_init (dumpfile)
       FILE *dumpfile;
  {
-   struct loops *loops = xcalloc (1, sizeof (struct loops));
    edge e;
  
    /* Avoid annoying special cases of edges going to exit
--- 41,46 ----
*************** loop_optimizer_init (dumpfile)
*** 48,98 ****
  
    /* Find the loops.  */
  
!   if (flow_loops_find (loops, LOOP_TREE) <= 1)
      {
        /* No loops.  */
!       flow_loops_free (loops);
!       free (loops);
        return NULL;
      }
  
    /* Not going to update these.  */
!   free (loops->cfg.rc_order);
!   loops->cfg.rc_order = NULL;
!   free (loops->cfg.dfs_order);
!   loops->cfg.dfs_order = NULL;
  
    /* Initialize structures for layout changes.  */
!   cfg_layout_initialize (loops);
  
    /* Create pre-headers.  */
!   create_preheaders (loops, CP_SIMPLE_PREHEADERS | CP_INSIDE_CFGLAYOUT);
  
    /* Force all latches to have only single successor.  */
!   force_single_succ_latches (loops);
  
    /* Mark irreducible loops.  */
!   mark_irreducible_loops (loops);
  
    /* Do we have histograms?  */
    if (find_counters_section (GCOV_TAG_LOOP_HISTOGRAMS)->present)
!     move_histograms_to_loops (loops);
  
    /* Dump loops.  */
!   flow_loops_dump (loops, dumpfile, NULL, 1);
  
  #ifdef ENABLE_CHECKING
!   verify_dominators (loops->cfg.dom);
!   verify_loop_structure (loops);
  #endif
  
!   return loops;
  }
  
  /* Finalize loop optimizer.  */
  void
! loop_optimizer_finalize (loops, dumpfile)
!      struct loops *loops;
       FILE *dumpfile;
  {
    basic_block bb;
--- 51,100 ----
  
    /* Find the loops.  */
  
!   REQ_STRUCTURE (loops, OK);
!   if (loop_tree.num <= 1)
      {
        /* No loops.  */
!       REQ_STRUCTURE (loops, NONE);
        return NULL;
      }
  
    /* Not going to update these.  */
!   free (loop_tree.cfg.rc_order);
!   loop_tree.cfg.rc_order = NULL;
!   free (loop_tree.cfg.dfs_order);
!   loop_tree.cfg.dfs_order = NULL;
  
    /* Initialize structures for layout changes.  */
!   cfg_layout_initialize (&loop_tree);
  
    /* Create pre-headers.  */
!   create_preheaders (&loop_tree, CP_SIMPLE_PREHEADERS | CP_INSIDE_CFGLAYOUT);
  
    /* Force all latches to have only single successor.  */
!   force_single_succ_latches (&loop_tree);
  
    /* Mark irreducible loops.  */
!   mark_irreducible_loops (&loop_tree);
  
    /* Do we have histograms?  */
    if (find_counters_section (GCOV_TAG_LOOP_HISTOGRAMS)->present)
!     move_histograms_to_loops (&loop_tree);
  
    /* Dump loops.  */
!   flow_loops_dump (&loop_tree, dumpfile, NULL, 1);
  
  #ifdef ENABLE_CHECKING
!   verify_dominators (loop_tree.cfg.dom);
!   verify_loop_structure (&loop_tree);
  #endif
  
!   return &loop_tree;
  }
  
  /* Finalize loop optimizer.  */
  void
! loop_optimizer_finalize (dumpfile)
       FILE *dumpfile;
  {
    basic_block bb;
*************** loop_optimizer_finalize (loops, dumpfile
*** 104,114 ****
        RBI (bb)->next = bb->next_bb;
  
    /* Another dump.  */
!   flow_loops_dump (loops, dumpfile, NULL, 1);
  
    /* Clean up.  */
!   flow_loops_free (loops);
!   free (loops);
   
    /* Finalize changes.  */
    cfg_layout_finalize ();
--- 106,115 ----
        RBI (bb)->next = bb->next_bb;
  
    /* Another dump.  */
!   flow_loops_dump (&loop_tree, dumpfile, NULL, 1);
  
    /* Clean up.  */
!   REQ_STRUCTURE (loops, NONE);
   
    /* Finalize changes.  */
    cfg_layout_finalize ();
Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/loop-unroll.c,v
retrieving revision 1.1.2.19
diff -c -3 -p -r1.1.2.19 loop-unroll.c
*** loop-unroll.c	4 Jan 2003 19:43:24 -0000	1.1.2.19
--- loop-unroll.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 32,38 ****
  #include "expr.h"
  
  static void decide_unrolling_and_peeling PARAMS ((struct loops *, int));
! static void peel_loops_completely PARAMS ((struct loops *, int));
  static void decide_peel_simple PARAMS ((struct loops *, struct loop *, int));
  static void decide_peel_once_rolling PARAMS ((struct loops *, struct loop *, int));
  static void decide_peel_completely PARAMS ((struct loops *, struct loop *, int));
--- 32,38 ----
  #include "expr.h"
  
  static void decide_unrolling_and_peeling PARAMS ((struct loops *, int));
! static bool peel_loops_completely PARAMS ((struct loops *, int));
  static void decide_peel_simple PARAMS ((struct loops *, struct loop *, int));
  static void decide_peel_once_rolling PARAMS ((struct loops *, struct loop *, int));
  static void decide_peel_completely PARAMS ((struct loops *, struct loop *, int));
*************** static void unroll_loop_runtime_iteratio
*** 48,64 ****
  						    struct loop *));
  
  /* Unroll and peel (depending on FLAGS) LOOPS.  */
! void
  unroll_and_peel_loops (loops, flags)
       struct loops *loops;
       int flags;
  {
    struct loop *loop, *next;
    int check;
  
    /* First perform complete loop peeling (it is almost surely a win,
       and affects parameters for further decision a lot).  */
!   peel_loops_completely (loops, flags);
  
    /* Now decide rest of unrolling and peeling.  */
    decide_unrolling_and_peeling (loops, flags);
--- 48,65 ----
  						    struct loop *));
  
  /* Unroll and peel (depending on FLAGS) LOOPS.  */
! bool
  unroll_and_peel_loops (loops, flags)
       struct loops *loops;
       int flags;
  {
    struct loop *loop, *next;
    int check;
+   int changed = false;
  
    /* First perform complete loop peeling (it is almost surely a win,
       and affects parameters for further decision a lot).  */
!   changed |= peel_loops_completely (loops, flags);
  
    /* Now decide rest of unrolling and peeling.  */
    decide_unrolling_and_peeling (loops, flags);
*************** unroll_and_peel_loops (loops, flags)
*** 105,110 ****
--- 106,112 ----
  	}
        if (check)
  	{
+ 	  changed = true;
  #ifdef ENABLE_CHECKING
  	  verify_dominators (loops->cfg.dom);
  	  verify_loop_structure (loops);
*************** unroll_and_peel_loops (loops, flags)
*** 112,126 ****
  	}
        loop = next;
      }
  }
  
  /* Check whether to peel loops completely and do so.  */
! static void
  peel_loops_completely (loops, flags)
       struct loops *loops;
       int flags;
  {
    struct loop *loop, *next;
  
    loop = loops->tree_root;
    while (loop->inner)
--- 114,130 ----
  	}
        loop = next;
      }
+   return changed;
  }
  
  /* Check whether to peel loops completely and do so.  */
! static bool
  peel_loops_completely (loops, flags)
       struct loops *loops;
       int flags;
  {
    struct loop *loop, *next;
+   int changed = false;
  
    loop = loops->tree_root;
    while (loop->inner)
*************** peel_loops_completely (loops, flags)
*** 171,176 ****
--- 175,181 ----
  
        if (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY)
  	{
+ 	  changed = true;
  	  peel_loop_completely (loops, loop);
  #ifdef ENABLE_CHECKING
  	  verify_dominators (loops->cfg.dom);
*************** peel_loops_completely (loops, flags)
*** 179,184 ****
--- 184,190 ----
  	}
        loop = next;
      }
+   return changed;
  }
  
  /* Decide whether unroll or peel and how much.  */
Index: loop-unswitch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/loop-unswitch.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 loop-unswitch.c
*** loop-unswitch.c	19 Dec 2002 21:29:38 -0000	1.1.2.6
--- loop-unswitch.c	6 Feb 2003 16:45:06 -0000
*************** Software Foundation, 59 Temple Place - S
*** 33,50 ****
  
  static struct loop *unswitch_loop	PARAMS ((struct loops *,
  						struct loop *, basic_block));
! static void unswitch_single_loop	PARAMS ((struct loops *, struct loop *,
  						rtx, int));
  static bool may_unswitch_on_p		PARAMS ((struct loops *, basic_block,
  						struct loop *, basic_block *));
  static rtx reversed_condition		PARAMS ((rtx));
  
  /* Unswitch LOOPS.  */
! void
  unswitch_loops (loops)
       struct loops *loops;
  {
    int i, num;
    struct loop *loop;
  
    /* Go through inner loops (only original ones).  */
--- 33,51 ----
  
  static struct loop *unswitch_loop	PARAMS ((struct loops *,
  						struct loop *, basic_block));
! static bool unswitch_single_loop	PARAMS ((struct loops *, struct loop *,
  						rtx, int));
  static bool may_unswitch_on_p		PARAMS ((struct loops *, basic_block,
  						struct loop *, basic_block *));
  static rtx reversed_condition		PARAMS ((rtx));
  
  /* Unswitch LOOPS.  */
! bool
  unswitch_loops (loops)
       struct loops *loops;
  {
    int i, num;
+   int changed = false;
    struct loop *loop;
  
    /* Go through inner loops (only original ones).  */
*************** unswitch_loops (loops)
*** 60,71 ****
        if (loop->inner)
  	continue;
  
!       unswitch_single_loop (loops, loop, NULL_RTX, 0);
  #ifdef ENABLE_CHECKING
        verify_dominators (loops->cfg.dom);
        verify_loop_structure (loops);
  #endif
      }
  }
  
  /* Checks whether we can unswitch LOOP on basic block BB.  LOOP BODY
--- 61,74 ----
        if (loop->inner)
  	continue;
  
!       changed |= unswitch_single_loop (loops, loop, NULL_RTX, 0);
  #ifdef ENABLE_CHECKING
        verify_dominators (loops->cfg.dom);
        verify_loop_structure (loops);
  #endif
      }
+ 
+   return changed;
  }
  
  /* Checks whether we can unswitch LOOP on basic block BB.  LOOP BODY
*************** reversed_condition (cond)
*** 127,133 ****
     unswitched on and are true in our branch.  NUM is number of unswitchings
     done; do not allow it to grow too much, it is too easy to create example
     on that the code would grow exponentially.  */
! static void
  unswitch_single_loop (loops, loop, cond_checked, num)
       struct loops *loops;
       struct loop *loop;
--- 130,136 ----
     unswitched on and are true in our branch.  NUM is number of unswitchings
     done; do not allow it to grow too much, it is too easy to create example
     on that the code would grow exponentially.  */
! static bool
  unswitch_single_loop (loops, loop, cond_checked, num)
       struct loops *loops;
       struct loop *loop;
*************** unswitch_single_loop (loops, loop, cond_
*** 142,147 ****
--- 145,151 ----
    int always_true;
    int always_false;
    int repeat;
+   int changed = false;
    edge e;
  
    /* Do not unswitch too much.  */
*************** unswitch_single_loop (loops, loop, cond_
*** 149,155 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching anymore, hit max level\n");
!       return;
      }
  
    /* We only unswitch innermost loops (at least for now).  */
--- 153,159 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching anymore, hit max level\n");
!       return false;
      }
  
    /* We only unswitch innermost loops (at least for now).  */
*************** unswitch_single_loop (loops, loop, cond_
*** 157,163 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, not innermost loop\n");
!       return;
      }
    
    /* And we must be able to duplicate loop body.  */
--- 161,167 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, not innermost loop\n");
!       return false;
      }
    
    /* And we must be able to duplicate loop body.  */
*************** unswitch_single_loop (loops, loop, cond_
*** 165,171 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, can't duplicate loop\n");
!       return;
      }
  
    /* Check the size of loop.  */
--- 169,175 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, can't duplicate loop\n");
!       return false;
      }
  
    /* Check the size of loop.  */
*************** unswitch_single_loop (loops, loop, cond_
*** 173,179 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, loop too big\n");
!       return;
      }
    
    /* Do not unswitch in cold areas.  */
--- 177,183 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, loop too big\n");
!       return false;
      }
    
    /* Do not unswitch in cold areas.  */
*************** unswitch_single_loop (loops, loop, cond_
*** 181,187 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, not hot area\n");
!       return;
      }
    
    /* Nor if it usually do not pass.  */
--- 185,191 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, not hot area\n");
!       return false;
      }
    
    /* Nor if it usually do not pass.  */
*************** unswitch_single_loop (loops, loop, cond_
*** 189,195 ****
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, loop iterations < 1\n");
!       return;
      }
  
    do
--- 193,199 ----
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Not unswitching, loop iterations < 1\n");
!       return false;
      }
  
    do
*************** unswitch_single_loop (loops, loop, cond_
*** 206,212 ****
        if (i == loop->num_nodes)
  	{
  	  free (bbs);
! 	  return;
  	}
  
        if (!(cond = get_condition (bbs[i]->end, &split_before)))
--- 210,216 ----
        if (i == loop->num_nodes)
  	{
  	  free (bbs);
! 	  return changed;
  	}
  
        if (!(cond = get_condition (bbs[i]->end, &split_before)))
*************** unswitch_single_loop (loops, loop, cond_
*** 239,244 ****
--- 243,249 ----
  	  remove_path (loops, e);
  	  free (bbs);
  	  repeat = 1;
+ 	  changed = true;
  	}
        else if (always_false)
  	{
*************** unswitch_single_loop (loops, loop, cond_
*** 247,252 ****
--- 252,258 ----
  	  remove_path (loops, e);
  	  free (bbs);
  	  repeat = 1;
+ 	  changed = true;
  	}
      } while (repeat);
   
*************** unswitch_single_loop (loops, loop, cond_
*** 275,280 ****
--- 281,288 ----
    free_EXPR_LIST_node (conds);
    if (rcond)
      free_EXPR_LIST_node (rconds);
+ 
+   return true;
  }
  
  /* Unswitch a LOOP w.r. to given basic block.  We only support unswitching
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.417.2.9
diff -c -3 -p -r1.417.2.9 loop.c
*** loop.c	23 Jan 2003 21:28:50 -0000	1.417.2.9
--- loop.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 57,62 ****
--- 57,64 ----
  #include "insn-flags.h"
  #include "optabs.h"
  #include "cfgloop.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* Not really meaningful values, but at least something.  */
  #ifndef SIMULTANEOUS_PREFETCHES
*************** loop_optimize (f, dumpfile, flags)
*** 509,515 ****
  
       We could have added a call to reg_scan after gcse_main in toplev.c,
       but moving this call to init_alias_analysis is more efficient.  */
!   init_alias_analysis ();
  
    /* See if we went too far.  Note that get_max_uid already returns
       one more that the maximum uid of all insn.  */
--- 511,517 ----
  
       We could have added a call to reg_scan after gcse_main in toplev.c,
       but moving this call to init_alias_analysis is more efficient.  */
!   REQ_STRUCTURE (alias_info, OK);
  
    /* See if we went too far.  Note that get_max_uid already returns
       one more that the maximum uid of all insn.  */
*************** loop_optimize (f, dumpfile, flags)
*** 551,558 ****
        if (! loop->invalid && loop->end)
  	scan_loop (loop, flags);
      }
- 
-   end_alias_analysis ();
  
    /* Clean up.  */
    free (uid_luid);
--- 553,558 ----
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.97.2.11
diff -c -3 -p -r1.97.2.11 profile.c
*** profile.c	23 Jan 2003 21:28:51 -0000	1.97.2.11
--- profile.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 73,78 ****
--- 73,80 ----
  #include "langhooks.h"
  #include "hashtab.h"
  #include "vpt.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* Additional information about the edges we need.  */
  struct edge_info {
*************** branch_prob ()
*** 1251,1257 ****
    unsigned i;
    unsigned num_edges, ignored_edges;
    struct edge_list *el;
-   struct loops loops;
    unsigned n_values;
    struct histogram_value *values;
    const char *name = IDENTIFIER_POINTER
--- 1253,1258 ----
*************** branch_prob ()
*** 1353,1365 ****
    /* Find loops and bring them into canonical shape.  We only need this when
       we profile loop histograms, but we may want to use the data collected
       with loop profiling without it.  */
!   flow_loops_find (&loops, LOOP_TREE);
!   create_preheaders (&loops, 0);
    /* Release dominators -- we aren't going to need them nor update them.  */
!   if (loops.cfg.dom)
      {
!       free_dominance_info (loops.cfg.dom);
!       loops.cfg.dom = NULL;
      }
  
    el = create_edge_list ();
--- 1354,1366 ----
    /* Find loops and bring them into canonical shape.  We only need this when
       we profile loop histograms, but we may want to use the data collected
       with loop profiling without it.  */
!   REQ_STRUCTURE (loops, OK);
!   create_preheaders (&loop_tree, 0);
    /* Release dominators -- we aren't going to need them nor update them.  */
!   if (loop_tree.cfg.dom)
      {
!       free_dominance_info (loop_tree.cfg.dom);
!       loop_tree.cfg.dom = NULL;
      }
  
    el = create_edge_list ();
*************** branch_prob ()
*** 1569,1575 ****
      {
        compute_branch_probabilities ();
        if (flag_loop_histograms)
! 	compute_loop_histograms (&loops);
        if (flag_value_histograms)
  	compute_value_histograms (n_values, values);
      }
--- 1570,1576 ----
      {
        compute_branch_probabilities ();
        if (flag_loop_histograms)
! 	compute_loop_histograms (&loop_tree);
        if (flag_value_histograms)
  	compute_value_histograms (n_values, values);
      }
*************** branch_prob ()
*** 1582,1588 ****
        
        instrument_edges (el);
        if (flag_loop_histograms)
! 	instrument_loops (&loops);
        if (flag_value_histograms)
  	instrument_values (n_values, values);
  
--- 1583,1589 ----
        
        instrument_edges (el);
        if (flag_loop_histograms)
! 	instrument_loops (&loop_tree);
        if (flag_value_histograms)
  	instrument_values (n_values, values);
  
*************** branch_prob ()
*** 1612,1618 ****
      }
  
    /* Free the loop datastructure.  */
!   flow_loops_free (&loops);
  
    if (flag_value_histograms)
      {
--- 1613,1619 ----
      }
  
    /* Free the loop datastructure.  */
!   REQ_STRUCTURE (loops, NONE);
  
    if (flag_value_histograms)
      {
*************** branch_prob ()
*** 1624,1630 ****
    free_aux_for_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);
  
--- 1625,1632 ----
    free_aux_for_edges ();
    /* Re-merge split basic blocks and the mess introduced by
       insert_insn_on_edge.  */
!   FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
!   RUN_PASS (cfg_cleanup, (profile_arc_flag ? CLEANUP_EXPENSIVE : 0, 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.4.2.4
diff -c -3 -p -r1.4.2.4 ra.c
*** ra.c	23 Jan 2003 21:28:51 -0000	1.4.2.4
--- ra.c	6 Feb 2003 16:45:07 -0000
***************
*** 39,44 ****
--- 39,46 ----
  #include "toplev.h"
  #include "flags.h"
  #include "ra.h"
+ #include "timevar.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,
--- 703,709 ----
       explicitly requested.  */
    if ((debug_new_regalloc & DUMP_REGCLASS) == 0)
      rtl_dump_file = NULL;
!   RUN_PASS (regclass, ());
    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
--- 805,816 ----
  	  /* And new insns.  */
  	  compute_bb_for_insn ();
  	  /* Some of them might be dead.  */
! 	  RUN_PASS (trivial_dce, ());
  	  /* 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.  */
! 	  RUN_PASS (regclass, ());
  	  rtl_dump_file = ra_dump_file;
  
  	  /* Remember the number of defs and uses, so we can distinguish
*************** reg_alloc ()
*** 858,867 ****
    /* 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_REG_INFO);
!   cleanup_cfg (CLEANUP_EXPENSIVE);
!   recompute_reg_usage (get_insns (), TRUE);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
    rtl_dump_file = ra_dump_file;
--- 860,868 ----
    /* Cleanup the flow graph.  */
    if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
      rtl_dump_file = NULL;
!   RUN_PASS (life_analysis, (PROP_DEATH_NOTES | PROP_REG_INFO));
!   RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
!   REQ_STRUCTURE (register_usage, OK);
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
    rtl_dump_file = ra_dump_file;
*************** reg_alloc ()
*** 887,899 ****
      ra_print_rtl_with_bb (rtl_dump_file, get_insns ());
    dump_static_insn_cost (rtl_dump_file,
  			 "after allocation/spilling, before reload", NULL);
- 
-   /* Allocate the reg_equiv_memory_loc array for reload.  */
-   reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
-   /* 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);
  }
  
  /*
--- 888,893 ----
Index: recog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.c,v
retrieving revision 1.164.2.7
diff -c -3 -p -r1.164.2.7 recog.c
*** recog.c	23 Jan 2003 21:28:52 -0000	1.164.2.7
--- recog.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 39,44 ****
--- 39,46 ----
  #include "basic-block.h"
  #include "output.h"
  #include "reload.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  #ifndef STACK_PUSH_CODE
  #ifdef STACK_GROWS_DOWNWARD
*************** split_insn (insn)
*** 2835,2843 ****
  }
  /* Split all insns in the function.  If UPD_LIFE, update life info after.  */
  
! void
! split_all_insns (upd_life)
!      int upd_life;
  {
    sbitmap blocks;
    int changed;
--- 2837,2844 ----
  }
  /* Split all insns in the function.  If UPD_LIFE, update life info after.  */
  
! int
! split_all_insns ()
  {
    sbitmap blocks;
    int changed;
*************** split_all_insns (upd_life)
*** 2881,2896 ****
        find_many_sub_basic_blocks (blocks);
      }
  
-   if (changed && upd_life)
-     {
-       count_or_remove_death_notes (blocks, 1);
-       update_life_info (blocks, UPDATE_LIFE_LOCAL, PROP_DEATH_NOTES);
-     }
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
  
    sbitmap_free (blocks);
  }
  
  /* Same as split_all_insns, but do not expect CFG to be available.
--- 2882,2893 ----
        find_many_sub_basic_blocks (blocks);
      }
  
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #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;
  {
--- 3102,3108 ----
  
  /* Perform the peephole2 optimization pass.  */
  
! int
  peephole2_optimize (dump_file)
       FILE *dump_file ATTRIBUTE_UNUSED;
  {
*************** peephole2_optimize (dump_file)
*** 3114,3138 ****
    regset live;
    int i;
    basic_block bb;
- #ifdef HAVE_conditional_execution
-   sbitmap blocks;
    bool changed;
- #endif
    bool do_cleanup_cfg = false;
    bool do_rebuild_jump_labels = false;
  
    /* Initialize the regsets we're going to use.  */
    for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
      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
  
    FOR_EACH_BB_REVERSE (bb)
      {
--- 3111,3128 ----
    regset live;
    int i;
    basic_block bb;
    bool changed;
    bool do_cleanup_cfg = false;
    bool do_rebuild_jump_labels = false;
+   int retval;
  
    /* Initialize the regsets we're going to use.  */
    for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
      peep2_insn_data[i].live_before = INITIALIZE_REG_SET (rs_heads[i]);
    live = INITIALIZE_REG_SET (rs_heads[i]);
  
    changed = false;
    count_or_remove_death_notes (NULL, 1);
  
    FOR_EACH_BB_REVERSE (bb)
      {
*************** peephole2_optimize (dump_file)
*** 3290,3299 ****
  				  = REG_BR_PROB_BASE - nehe->probability;
  
  			        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;
  			      }
--- 3280,3287 ----
  				  = REG_BR_PROB_BASE - nehe->probability;
  
  			        do_cleanup_cfg |= purge_dead_edges (nfte->dest);
! 				bb->flags |= BB_DIRTY;
  				changed = true;
  				bb = nfte->src;
  				eh_edge = nehe;
  			      }
*************** peephole2_optimize (dump_file)
*** 3304,3318 ****
  		      do_cleanup_cfg |= purge_dead_edges (bb);
  		    }
  
  #ifdef HAVE_conditional_execution
  		  /* With conditional execution, we cannot back up the
  		     live information so easily, since the conditional
  		     death data structures are not so self-contained.
  		     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;
  		  peep2_insn_data[peep2_current].insn = PEEP2_EOB;
--- 3292,3305 ----
  		      do_cleanup_cfg |= purge_dead_edges (bb);
  		    }
  
+ 		  bb->flags |= BB_DIRTY;
+ 		  changed = true;
  #ifdef HAVE_conditional_execution
  		  /* With conditional execution, we cannot back up the
  		     live information so easily, since the conditional
  		     death data structures are not so self-contained.
  		     So record that we've made a modification to this
  		     block and update life information at the end.  */
  		  for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
  		    peep2_insn_data[i].insn = NULL_RTX;
  		  peep2_insn_data[peep2_current].insn = PEEP2_EOB;
*************** peephole2_optimize (dump_file)
*** 3370,3391 ****
    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
!   else
!     {
!       count_or_remove_death_notes (blocks, 1);
!       update_life_info (blocks, UPDATE_LIFE_LOCAL, PROP_DEATH_NOTES);
!     }
!   sbitmap_free (blocks);
  #endif
  }
  #endif /* HAVE_peephole2 */
  
--- 3357,3381 ----
    if (do_rebuild_jump_labels)
      rebuild_jump_labels (get_insns ());
  
+   retval = 0;
+ 
    /* 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)
      {
!       FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
!       RUN_PASS (cfg_cleanup, (0, 0));
!       retval |= 6; 
      }
  #ifdef HAVE_conditional_execution
!   FORCE_STRUCTURE (death_notes, DIRTY);
!   retval |= 1;
  #endif
+   if (changed)
+     retval |= 4;
+ 
+   return retval;
  }
  #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	6 Feb 2003 16:45:07 -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 int 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.112.2.6
diff -c -3 -p -r1.112.2.6 reg-stack.c
*** reg-stack.c	11 Jan 2003 15:34:13 -0000	1.112.2.6
--- reg-stack.c	6 Feb 2003 16:45:07 -0000
***************
*** 170,175 ****
--- 170,177 ----
  #include "varray.h"
  #include "reload.h"
  #include "ggc.h"
+ #include "timevar.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.
*************** pop_stack (regstack, regno)
*** 418,424 ****
  
  void
  reg_to_stack (first, file)
!      rtx first;
       FILE *file;
  {
    basic_block bb;
--- 420,426 ----
  
  void
  reg_to_stack (first, file)
!      rtx first ATTRIBUTE_UNUSED;
       FILE *file;
  {
    basic_block bb;
*************** 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.  */
--- 431,437 ----
    stack_regs_mentioned_data = 0;
  
    if (!optimize)
!     RUN_PASS (split_insns, ());
  
    /* See if there is something to do.  Flow analysis is quite
       expensive so we might save some compilation time.  */
*************** reg_to_stack (first, file)
*** 439,451 ****
    if (i > LAST_STACK_REG)
      return;
  
!   /* Ok, floating point instructions exist.  If not optimizing,
!      build the CFG and run life analysis.  */
!   if (!optimize)
!     {
!       count_or_remove_death_notes (NULL, 1);
!       life_analysis (first, file, PROP_DEATH_NOTES);
!     }
    mark_dfs_back_edges ();
  
    /* Set up block info for each basic block.  */
--- 441,447 ----
    if (i > LAST_STACK_REG)
      return;
  
!   REQ_STRUCTURE (liveness, OK);
    mark_dfs_back_edges ();
  
    /* Set up block info for each basic block.  */
Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.59.2.6
diff -c -3 -p -r1.59.2.6 regrename.c
*** regrename.c	6 Feb 2003 11:33:48 -0000	1.59.2.6
--- regrename.c	6 Feb 2003 16:45:07 -0000
***************
*** 37,42 ****
--- 37,44 ----
  #include "flags.h"
  #include "toplev.h"
  #include "obstack.h"
+ #include "timevar.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)
*************** regrename_optimize ()
*** 365,374 ****
  
    if (rtl_dump_file)
      fputc ('\n', rtl_dump_file);
- 
-   count_or_remove_death_notes (NULL, 1);
-   update_life_info (NULL, UPDATE_LIFE_LOCAL,
- 		    PROP_REG_INFO | PROP_DEATH_NOTES);
  }
  
  static void
--- 367,372 ----
*************** copyprop_hardreg_forward_1 (bb, vd)
*** 1750,1755 ****
--- 1748,1754 ----
  	      rtx new;
  
  	      changed = true;
+ 	      bb->flags |= BB_DIRTY;
  
  	      new = *recog_data.operand_loc[i];
  	      recog_data.operand[i] = new;
*************** copyprop_hardreg_forward_1 (bb, vd)
*** 1782,1788 ****
  
  /* 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 ()
*** 1819,1835 ****
        if (rtl_dump_file)
  	fputs ("\n\n", rtl_dump_file);
  
!       /* ??? 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
! 			| PROP_KILL_DEAD_CODE);
      }
  
    free (all_vd);
  }
  
  /* Dump the value chain data to stderr.  */
--- 1818,1829 ----
        if (rtl_dump_file)
  	fputs ("\n\n", rtl_dump_file);
  
!       RUN_PASS (delete_noop_moves, ());
!       RUN_PASS (dce, ());
      }
  
    free (all_vd);
+   return need_refresh;
  }
  
  /* Dump the value chain data to stderr.  */
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.354.2.11
diff -c -3 -p -r1.354.2.11 reload1.c
*** reload1.c	23 Jan 2003 21:28:53 -0000	1.354.2.11
--- reload1.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 44,49 ****
--- 44,51 ----
  #include "toplev.h"
  #include "except.h"
  #include "tree.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* This file contains the reload pass of the compiler, which is
     run after register allocation has been done.  It checks that
*************** reload (first, global)
*** 1267,1275 ****
    if (reg_equiv_constant)
      free (reg_equiv_constant);
    reg_equiv_constant = 0;
-   if (reg_equiv_memory_loc)
-     free (reg_equiv_memory_loc);
-   reg_equiv_memory_loc = 0;
  
    if (real_known_ptr)
      free (real_known_ptr);
--- 1269,1274 ----
*************** reload_cse_regs_1 (first)
*** 8130,8136 ****
    rtx testreg = gen_rtx_REG (VOIDmode, -1);
  
    cselib_init ();
!   init_alias_analysis ();
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      {
--- 8129,8135 ----
    rtx testreg = gen_rtx_REG (VOIDmode, -1);
  
    cselib_init ();
!   REQ_STRUCTURE (alias_info, OK);
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      {
*************** reload_cse_regs_1 (first)
*** 8141,8147 ****
      }
  
    /* Clean up.  */
-   end_alias_analysis ();
    cselib_finish ();
  }
  
--- 8140,8145 ----
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.367.2.11
diff -c -3 -p -r1.367.2.11 rtl.h
*** rtl.h	23 Jan 2003 21:28:54 -0000	1.367.2.11
--- rtl.h	6 Feb 2003 16:45:07 -0000
*************** extern enum reg_class reg_alternate_clas
*** 1726,1732 ****
  
  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
--- 1726,1732 ----
  
  extern rtx get_first_nonparm_insn	PARAMS ((void));
  
! extern int split_all_insns		PARAMS ((void));
  extern void split_all_insns_noflow	PARAMS ((void));
  
  #define MAX_SAVED_CONST_INT 64
*************** extern void delete_for_peephole		PARAMS 
*** 2000,2006 ****
  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));
--- 2000,2006 ----
  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
*** 2114,2122 ****
  						 unsigned int));
  
  /* 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 *));
--- 2114,2122 ----
  						 unsigned int));
  
  /* In flow.c */
! extern void recompute_reg_usage			PARAMS ((void));
  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 dump_local_alloc		PARAMS ((F
*** 2188,2193 ****
--- 2188,2196 ----
  extern int local_alloc			PARAMS ((void));
  extern int function_invariant_p		PARAMS ((rtx));
  
+ /* In ra.c.  */
+ extern void reg_alloc			PARAMS ((void));
+ 
  /* In profile.c */
  extern void init_branch_prob		PARAMS ((const char *));
  extern void branch_prob			PARAMS ((void));
*************** extern GTY(()) rtx stack_limit_rtx;
*** 2318,2333 ****
  
  /* 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 */
  
--- 2321,2336 ----
  
  /* 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: sched-ebb.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-ebb.c,v
retrieving revision 1.17.6.9
diff -c -3 -p -r1.17.6.9 sched-ebb.c
*** sched-ebb.c	23 Jan 2003 21:28:54 -0000	1.17.6.9
--- sched-ebb.c	6 Feb 2003 16:45:07 -0000
*************** schedule_ebbs (dump_file)
*** 458,464 ****
    current_sched_info = &ebb_sched_info;
  
    allocate_reg_life_data ();
-   compute_bb_for_insn ();
  
    /* Schedule every region in the subroutine.  */
    FOR_EACH_BB (bb)
--- 458,463 ----
Index: sibcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sibcall.c,v
retrieving revision 1.39.2.3
diff -c -3 -p -r1.39.2.3 sibcall.c
*** sibcall.c	4 Jan 2003 18:56:07 -0000	1.39.2.3
--- sibcall.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 34,39 ****
--- 34,41 ----
  #include "output.h"
  #include "except.h"
  #include "tree.h"
+ #include "timevar.h"
+ #include "passes.h"
  
  /* In case alternate_exit_block contains copy from pseudo, to return value,
     record the pseudo here.  In such case the pseudo must be set to function
*************** 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;
--- 584,589 ----
*************** optimize_sibling_and_tail_recursive_call
*** 767,772 ****
      reorder_blocks ();
  
    /* This information will be invalid after inline expansion.  Kill it now.  */
-   free_basic_block_vars (0);
    free_EXPR_LIST_list (&tail_recursion_label_list);
  }
--- 767,771 ----
Index: ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ssa-ccp.c,v
retrieving revision 1.26.2.2
diff -c -3 -p -r1.26.2.2 ssa-ccp.c
*** ssa-ccp.c	4 Jan 2003 18:56:08 -0000	1.26.2.2
--- ssa-ccp.c	6 Feb 2003 16:45:07 -0000
*************** ssa_const_prop ()
*** 985,993 ****
    unsigned int i;
    edge curredge;
  
-   /* We need alias analysis (for what?) */
-   init_alias_analysis ();
- 
    df_analyzer = df_init ();
    df_analyse (df_analyzer, 0,
  	      DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
--- 985,990 ----
*************** ssa_const_prop ()
*** 1089,1095 ****
    executable_edges = NULL;
  
    df_finish (df_analyzer);
-   end_alias_analysis ();
  }
  
  static int
--- 1086,1091 ----
Index: ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ssa.c,v
retrieving revision 1.53.2.3
diff -c -3 -p -r1.53.2.3 ssa.c
*** ssa.c	4 Jan 2003 18:56:08 -0000	1.53.2.3
--- ssa.c	6 Feb 2003 16:45:07 -0000
*************** convert_to_ssa ()
*** 1178,1187 ****
    if (in_ssa_form)
      abort ();
  
-   /* 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);
  
    if (rtl_dump_file)
--- 1178,1183 ----
*************** convert_from_ssa ()
*** 2174,2187 ****
  {
    basic_block b, bb;
    partition reg_partition;
-   rtx insns = get_insns ();
- 
-   /* Need global_live_at_{start,end} up to date.  There should not be
-      any significant dead code at this point, except perhaps dead
-      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.  */
--- 2170,2175 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.668.2.33
diff -c -3 -p -r1.668.2.33 toplev.c
*** toplev.c	28 Jan 2003 22:47:46 -0000	1.668.2.33
--- toplev.c	6 Feb 2003 16:45:07 -0000
*************** Software Foundation, 59 Temple Place - S
*** 76,81 ****
--- 76,82 ----
  #include "cfgloop.h"
  #include "gcse-globals.h"
  #include "vpt.h"
+ #include "passes.h"
  
  #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
  #include "dwarf2out.h"
*************** Software Foundation, 59 Temple Place - S
*** 100,107 ****
  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));
--- 101,106 ----
*************** static int print_single_switch PARAMS ((
*** 132,137 ****
--- 131,139 ----
  static void print_switch_values PARAMS ((FILE *, int, int, const char *,
  				       const char *, const char *));
  
+ /* Current declaration.  */
+ tree current_decl;
+ 
  /* Nonzero to dump debug info whilst parsing (-dy option).  */
  static int set_yydebug;
  
*************** struct dump_file_info
*** 219,271 ****
    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_vpt,
-   DFI_ce1,
-   DFI_tracer,
-   DFI_loop2,
-   DFI_web,
-   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_vartrack,
-   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.
  
--- 221,226 ----
*************** static struct dump_file_info dump_file[D
*** 319,327 ****
    { "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.  */
  
--- 274,279 ----
*************** int liveness_update_failures = 0;	/* # o
*** 475,480 ****
--- 427,435 ----
  int liveness_local_updates = 0;		/* # of local updates.  */
  int liveness_local_targetted_updates = 0; /* # of local updates with set
  					     of blocks specified.  */
+ 
+ /* Dump actions performed on structures to stderr.  */
+ int dump_structure_manipulations = 0;
  
  /* -f flags.  */
  
*************** static const lang_independent_options f_
*** 1276,1281 ****
--- 1231,1238 ----
     N_("Report on permanent memory allocation at end of run") },
    {"structures-report", &structure_statistics, 1,
     N_("Report on structures computation and usage") },
+   {"dump-structure-manipulations", &dump_structure_manipulations, 1,
+    N_("Dump actions performed on structures to stderr") },
    { "trapv", &flag_trapv, 1,
     N_("Trap for signed overflow in addition / subtraction / multiplication") },
    { "new-ra", &flag_new_regalloc, 1,
*************** output_file_directive (asm_file, input_n
*** 1890,1896 ****
  
  /* 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;
--- 1847,1853 ----
  
  /* 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)
*** 1948,1954 ****
  
  /* Routine to close a dump file.  */
  
! static void
  close_dump_file (index, func, insns)
       enum dump_file_index index;
       void (*func) PARAMS ((FILE *, rtx));
--- 1905,1911 ----
  
  /* Routine to close a dump file.  */
  
! void
  close_dump_file (index, func, insns)
       enum dump_file_index index;
       void (*func) PARAMS ((FILE *, rtx));
*************** void
*** 2470,2480 ****
  rest_of_compilation (decl)
       tree decl;
  {
-   rtx insns;
    int tem;
    int failure = 0;
    int rebuild_label_notes_after_reload;
!   int register_life_up_to_date;
  
    timevar_push (TV_REST_OF_COMPILATION);
  
--- 2427,2438 ----
  rest_of_compilation (decl)
       tree decl;
  {
    int tem;
    int failure = 0;
    int rebuild_label_notes_after_reload;
!   int tracking_structures = 0;
! 
!   current_decl = decl;
  
    timevar_push (TV_REST_OF_COMPILATION);
  
*************** rest_of_compilation (decl)
*** 2553,2567 ****
  	    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
--- 2511,2523 ----
  	    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)
*** 2603,2611 ****
  	      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;
  
--- 2559,2567 ----
  	      int saved_optimize = optimize;
  
  	      optimize = 0;
! 	      rebuild_jump_labels (get_insns ());
  	      find_exception_handler_labels ();
! 	      find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
  	      cleanup_cfg (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP);
  	      optimize = saved_optimize;
  
*************** rest_of_compilation (decl)
*** 2680,2711 ****
        || errorcount || sorrycount)
      goto exit_rest_of_compilation;
  
    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
--- 2636,2659 ----
        || errorcount || sorrycount)
      goto exit_rest_of_compilation;
  
+   /* Start tracking structures.  */
+   init_structure_states ();
+   tracking_structures = 1;
+ 
    timevar_push (TV_JUMP);
    open_dump_file (DFI_sibling, decl);
  
!   RUN_PASS (delete_unreachable_blocks, ());
  
    /* Turn NOTE_INSN_PREDICTIONs into branch predictions.  */
!   RUN_PASS (lower_prediction_notes, ());
  
    /* 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;
!       RUN_PASS (tail_recursion_optimalization, ());
  
        /* There is pass ordering problem - we must lower NOTE_INSN_PREDICTION
           notes before simplifying cfg and we must do lowering after sibcall
*************** rest_of_compilation (decl)
*** 2724,2738 ****
    scope_to_insns_initialize ();
    /* Complete generation of exception handling code.  */
    if (doing_eh (0))
!     {
!       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);
!     }
  
    /* Delay emitting hard_reg_initial_value sets until after EH landing pad
       generation, which might create new sets.  */
--- 2672,2678 ----
    scope_to_insns_initialize ();
    /* Complete generation of exception handling code.  */
    if (doing_eh (0))
!     RUN_PASS (finish_eh_generation, ());
  
    /* Delay emitting hard_reg_initial_value sets until after EH landing pad
       generation, which might create new sets.  */
*************** rest_of_compilation (decl)
*** 2742,2756 ****
    /* If we are doing position-independent code generation, now
       is the time to output special prologues and epilogues.
       We do not want to do this earlier, because it just clutters
!      up inline functions with meaningless insns.  */
    if (flag_pic)
      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.
--- 2682,2694 ----
    /* If we are doing position-independent code generation, now
       is the time to output special prologues and epilogues.
       We do not want to do this earlier, because it just clutters
!      up inline functions with meaningless get_insns ().  */
    if (flag_pic)
      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)
*** 2758,2768 ****
       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);
  
--- 2696,2706 ----
       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)
!     RUN_PASS (optimize_save_area_alloca, ());
  #endif
  
    /* Instantiate all virtual registers.  */
!   instantiate_virtual_regs (current_function_decl, get_insns ());
  
    open_dump_file (DFI_jump, decl);
  
*************** rest_of_compilation (decl)
*** 2773,2796 ****
    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_with_bb, insns);
  
    /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
    if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
--- 2711,2730 ----
    timevar_push (TV_JUMP);
    /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB.  Do this
       before jump optimization switches branch directions.  */
!   RUN_PASS (lower_expected_value_notes, ());
  
!   reg_scan (get_insns (), max_reg_num (), 0);
!   RUN_PASS (cfg_cleanup,
! 	    ((optimize ? CLEANUP_EXPENSIVE : 0)
! 	     | CLEANUP_PRE_LOOP
! 	     | (flag_thread_jumps ? CLEANUP_THREADING : 0), 1));
! 
!   RUN_PASS (copy_loop_headers, ());
!   purge_line_number_notes (get_insns ());
!   REQ_STRUCTURE (cfg, OK);	/* Because of the following dump.  */
  
    timevar_pop (TV_JUMP);
!   close_dump_file (DFI_jump, print_rtl_with_bb, 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)
*** 2803,2830 ****
       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
--- 2737,2745 ----
       stuff at this time.  */
    if (optimize > 0 && flag_ssa)
      {
        /* Perform sparse conditional constant propagation, if requested.  */
        if (flag_ssa_ccp)
! 	RUN_PASS (ssa_ccp, ());
  
        /* It would be useful to cleanup the CFG at this point, but block
  	 merging and possibly other transformations might leave a PHI
*************** rest_of_compilation (decl)
*** 2836,2884 ****
  	 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)
!     {
!       open_dump_file (DFI_null, decl);
!       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
       have reduced the number of instructions substantially.  CSE, and
--- 2751,2765 ----
  	 may cause problems.  */
  
        if (flag_ssa_dce)
! 	RUN_PASS (ssa_dce, ());
      }
    timevar_push (TV_JUMP);
! 
!   RUN_PASS (cfg_cleanup, (optimize ? CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP: 0, 0));
  
    /* Try to identify useless null pointer tests and delete them.  */
    if (flag_delete_null_pointer_checks)
!     RUN_PASS (delete_null_pointer_checks, ());
  
    /* Jump optimization, and the removal of NULL pointer checks, may
       have reduced the number of instructions substantially.  CSE, and
*************** rest_of_compilation (decl)
*** 2888,2894 ****
    renumber_insns (rtl_dump_file);
    timevar_pop (TV_JUMP);
  
!   close_dump_file (DFI_jump, print_rtl_with_bb, insns);
  
    ggc_collect ();
  
--- 2769,2775 ----
    renumber_insns (rtl_dump_file);
    timevar_pop (TV_JUMP);
  
!   close_dump_file (DFI_jump, print_rtl_with_bb, get_insns ());
  
    ggc_collect ();
  
*************** rest_of_compilation (decl)
*** 2900,2931 ****
    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);
  	}
  
--- 2781,2805 ----
    if (optimize > 0)
      {
        open_dump_file (DFI_cse, decl);
+       REQ_STRUCTURE (cfg, OK);
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
        timevar_push (TV_CSE);
  
!       tem = RUN_PASS (cse, (0));
  
        /* 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)
! 	RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP, 0));
! 
        /* Try to identify useless null pointer tests and delete them.  */
        if (flag_delete_null_pointer_checks)
  	{
  	  timevar_push (TV_JUMP);
! 	  RUN_PASS (delete_null_pointer_checks, ());
  	  timevar_pop (TV_JUMP);
  	}
  
*************** rest_of_compilation (decl)
*** 2934,2950 ****
        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 ();
  
--- 2808,2824 ----
        renumber_insns (rtl_dump_file);
  
        timevar_pop (TV_CSE);
!       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)
*** 2953,2966 ****
    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;
--- 2827,2837 ----
    if (optimize > 0 && flag_gcse)
      {
        int save_csb, save_cfj;
  
        timevar_push (TV_GCSE);
        open_dump_file (DFI_gcse, decl);
  
!       tem = RUN_PASS (gcse, ());
  
        save_csb = flag_cse_skip_blocks;
        save_cfj = flag_cse_follow_jumps;
*************** rest_of_compilation (decl)
*** 2971,3006 ****
        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 ();
--- 2842,2870 ----
        if (flag_expensive_optimizations)
  	{
  	  timevar_push (TV_CSE);
! 	  tem |= RUN_PASS (cse, (0));
  	  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)
  	{
! 	  tem = 0;
  	  timevar_push (TV_JUMP);
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP, 0));
  	  timevar_pop (TV_JUMP);
  
  	  if (flag_expensive_optimizations)
  	    {
  	      timevar_push (TV_CSE);
! 	      tem = RUN_PASS (cse, (0));
  	      timevar_pop (TV_CSE);
  	    }
  	}
  
!       close_dump_file (DFI_gcse, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_GCSE);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3020,3060 ****
      {
        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_old_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 ();
      }
--- 2884,2922 ----
      {
        int do_unroll, do_prefetch;
  
+       do_unroll = flag_old_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
+       do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
+ 
        timevar_push (TV_LOOP);
!       RUN_PASS (delete_dead_jumptables, ());
!       RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP, 0));
        open_dump_file (DFI_loop, decl);
!       cleanup_barriers ();
  
        if (flag_rerun_loop_opt)
  	{
  	  /* We only want to perform unrolling once.  */
! 
! 	  RUN_PASS (old_loop_optimizer, (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.  */
! 	  RUN_PASS (trivial_dce, ());
  
  	  /* The regscan pass is currently necessary as the alias
  		  analysis code depends on this information.  */
! 	  reg_scan (get_insns (), max_reg_num (), 1);
! 	  cleanup_barriers ();
  	}
!       RUN_PASS (old_loop_optimizer, (do_unroll | LOOP_BCT | do_prefetch));
  
        /* Loop can create trivially dead instructions.  */
!       RUN_PASS (trivial_dce, ());
!       close_dump_file (DFI_loop, print_rtl, get_insns ());
        timevar_pop (TV_LOOP);
  
        ggc_collect ();
      }
*************** rest_of_compilation (decl)
*** 3062,3083 ****
    /* 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 ();
  
  #ifdef ENABLE_CHECKING
--- 2924,2930 ----
    /* Perform jump bypassing and control flow optimizations.  */
    if (optimize > 0 && flag_gcse)
      {
!       RUN_PASS (bypass_jumps, ());
        ggc_collect ();
  
  #ifdef ENABLE_CHECKING
*************** rest_of_compilation (decl)
*** 3090,3099 ****
  
    timevar_push (TV_FLOW);
    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
--- 2937,2945 ----
  
    timevar_push (TV_FLOW);
    open_dump_file (DFI_cfg, decl);
!   RUN_PASS (cfg_cleanup,
! 	    ((optimize ? CLEANUP_EXPENSIVE : 0)
! 	     | (flag_thread_jumps ? CLEANUP_THREADING : 0), 1));
  
    /* 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)
*** 3103,3142 ****
       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)
! 	{
! 	  if (flag_value_histograms)
! 	    {
! 	      /* Mark unused registers.  This is needed to turn divmods back into
! 		 corresponding divs/mods.  */
! 	      life_analysis (get_insns (), NULL, PROP_DEATH_NOTES);
! 	    }
! 	  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, get_insns ());
        timevar_pop (TV_BRANCH_PROB);
      }
--- 2949,2970 ----
       life_analysis rarely eliminates modification of external memory.
     */
    if (optimize)
!     RUN_PASS (mark_constant_function, ());
  
!   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)
      {
        timevar_push (TV_BRANCH_PROB);
        open_dump_file (DFI_bp, decl);
        if (cfun->arc_profile || flag_branch_probabilities)
! 	RUN_PASS (branch_prob, ());
  
        /* Estimate using heuristics if no profiling info is available.  */
        if (flag_guess_branch_prob)
! 	RUN_PASS (profile_estimation, ());
  
        close_dump_file (DFI_bp, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_BRANCH_PROB);
      }
*************** rest_of_compilation (decl)
*** 3145,3182 ****
        && flag_branch_probabilities
        && flag_value_histograms
        && flag_value_profile_transformations)
!     {
!       open_dump_file (DFI_vpt, decl);
! 
!       if (value_profile_transformations ())
! 	cleanup_cfg (CLEANUP_EXPENSIVE);
  
-       close_dump_file (DFI_vpt, print_rtl_with_bb, get_insns ());
-     }
    if ((cfun->arc_profile || flag_branch_probabilities)
        && flag_value_histograms)
!     {
!       reg_scan (get_insns (), max_reg_num (), 1);
!       count_or_remove_death_notes (NULL, 1);
!     }
  
    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);
!       delete_trivially_dead_insns (insns, max_reg_num ());
!       reg_scan (insns, max_reg_num (), 0);
        timevar_pop (TV_JUMP);
        close_dump_file (DFI_ce1, print_rtl_with_bb, get_insns ());
      }
--- 2973,2997 ----
        && flag_branch_probabilities
        && flag_value_histograms
        && flag_value_profile_transformations)
!     RUN_PASS (vpt, ());
  
    if ((cfun->arc_profile || flag_branch_probabilities)
        && flag_value_histograms)
!     reg_scan (get_insns (), max_reg_num (), 1);
  
    if (optimize >= 0)
      {
        open_dump_file (DFI_ce1, decl);
        if (flag_if_conversion)
  	{
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 1));
! 	  reg_scan (get_insns (), max_reg_num (), 0);
! 	  RUN_PASS (if_conversion, (0, TV_IFCVT));
  	}
        timevar_push (TV_JUMP);
!       RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
!       RUN_PASS (trivial_dce, ());
!       reg_scan (get_insns (), max_reg_num (), 0);
        timevar_pop (TV_JUMP);
        close_dump_file (DFI_ce1, print_rtl_with_bb, get_insns ());
      }
*************** rest_of_compilation (decl)
*** 3184,3194 ****
      {
        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);
      }
--- 2999,3010 ----
      {
        timevar_push (TV_TRACER);
        open_dump_file (DFI_tracer, decl);
+       REQ_STRUCTURE (cfg, OK);
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
!       if (RUN_PASS (tracer, ()))
! 	RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
!       reg_scan (get_insns (), max_reg_num (), 0);
        close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_TRACER);
      }
*************** rest_of_compilation (decl)
*** 3199,3271 ****
  	  || flag_peel_loops
  	  || flag_unroll_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)
! 	{
! 	  /* Here will go optimalizations.  */
! 	  if (flag_unswitch_loops)
! 	    unswitch_loops (loops);
! 
!  	  if (flag_peel_loops || flag_unroll_loops)
!  	    unroll_and_peel_loops (loops,
! 		(flag_peel_loops ? UAP_PEEL : 0) |
! 		(flag_unroll_loops ? UAP_UNROLL : 0) |
! 		(flag_unroll_all_loops ? UAP_UNROLL_ALL : 0));
  
! 	  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 ();
      }
-   if (flag_web)
-     {
-       open_dump_file (DFI_web, decl);
-       timevar_push (TV_WEB);
-       cleanup_cfg (0);
-       web_main ();
-       delete_trivially_dead_insns (get_insns (), max_reg_num ());
-       cleanup_cfg (CLEANUP_EXPENSIVE);
  
!       timevar_pop (TV_WEB);
!       close_dump_file (DFI_web, print_rtl_with_bb, get_insns ());
!       reg_scan (get_insns (), max_reg_num (), 0);
!     }
  
    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);
      }
--- 3015,3062 ----
  	  || flag_peel_loops
  	  || flag_unroll_loops))
      {
        timevar_push (TV_LOOP);
        open_dump_file (DFI_loop2, decl);
  
!       /* Unswitching.  */
!       if (flag_unswitch_loops)
! 	RUN_PASS (unswitch_loops, ());
! 
!       /* Unrolling and peeling.  */
!       if (flag_peel_loops || flag_unroll_loops)
! 	RUN_PASS (unroll_and_peel_loops,
! 		  ((flag_peel_loops ? UAP_PEEL : 0) |
! 		   (flag_unroll_loops ? UAP_UNROLL : 0) |
! 		   (flag_unroll_all_loops ? UAP_UNROLL_ALL : 0)));
  
!       REQ_STRUCTURE (loops_for_loop2, NONE);
!       REQ_STRUCTURE (cfg, OK);
        close_dump_file (DFI_loop2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_LOOP);
        ggc_collect ();
      }
  
!   if (flag_web)
!     RUN_PASS (webizer, ());
  
    if (flag_rerun_cse_after_loop)
      {
        timevar_push (TV_CSE2);
        open_dump_file (DFI_cse2, decl);
+       REQ_STRUCTURE (cfg, OK);
        if (rtl_dump_file)
  	dump_flow_info (rtl_dump_file);
!       tem = RUN_PASS (cse, (1));
  
        if (tem)
  	{
  	  timevar_push (TV_JUMP);
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
  	  timevar_pop (TV_JUMP);
  	}
! 
!       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)
*** 3280,3289 ****
  #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;
--- 3071,3082 ----
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
!   RUN_PASS (life_analysis, (PROP_FINAL));
    if (optimize)
!     RUN_PASS (cfg_cleanup, ((optimize ? CLEANUP_EXPENSIVE : 0)
! 			    | CLEANUP_UPDATE_LIFE
! 			    | (flag_thread_jumps ? CLEANUP_THREADING : 0),
! 			    0));
    timevar_pop (TV_FLOW);
  
    no_new_pseudos = 1;
*************** rest_of_compilation (decl)
*** 3295,3314 ****
  	setjmp_args_warning ();
      }
  
!   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_REG_INFO
! 					    | PROP_DEATH_NOTES);
! 	}
!     }
  
!   close_dump_file (DFI_life, print_rtl_with_bb, insns);
  
    ggc_collect ();
  
--- 3088,3097 ----
  	setjmp_args_warning ();
      }
  
!   if (optimize && !flag_new_regalloc)
!     RUN_PASS (initialize_uninitialized_subregs, ());
  
!   close_dump_file (DFI_life, print_rtl_with_bb, get_insns ());
  
    ggc_collect ();
  
*************** rest_of_compilation (decl)
*** 3316,3345 ****
  
    if (optimize > 0)
      {
!       int rebuild_jump_labels_after_combine = 0;
! 
!       timevar_push (TV_COMBINE);
!       open_dump_file (DFI_combine, decl);
! 
!       update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_LOG_LINKS);
!       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 ();
      }
  
--- 3099,3105 ----
  
    if (optimize > 0)
      {
!       RUN_PASS (combine_instructions, ());
        ggc_collect ();
      }
  
*************** rest_of_compilation (decl)
*** 3347,3396 ****
       now meet sequence length restrictions.  */
    if (flag_if_conversion)
      {
-       timevar_push (TV_IFCVT);
        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);
      }
  
    /* Register allocation pre-pass, to reduce number of moves
       necessary for two-address machines.  */
    if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
      {
!       timevar_push (TV_REGMOVE);
!       open_dump_file (DFI_regmove, decl);
! 
!       update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_LOG_LINKS);
!       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 ();
      }
  
    /* Do unconditional splitting before register allocation to allow machine
       description to add extra information not needed previously.  */
!   split_all_insns (1);
! 
!   /* Any of the several passes since flow1 will have munged register
!      lifetime data a bit.  */
!   register_life_up_to_date = 0;
  
  #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
  
    timevar_push (TV_SCHED);
--- 3107,3135 ----
       now meet sequence length restrictions.  */
    if (flag_if_conversion)
      {
        open_dump_file (DFI_ce2, decl);
  
        no_new_pseudos = 0;
!       RUN_PASS (if_conversion, (1, TV_IFCVT));
        no_new_pseudos = 1;
  
!       close_dump_file (DFI_ce2, print_rtl_with_bb, get_insns ());
      }
  
    /* Register allocation pre-pass, to reduce number of moves
       necessary for two-address machines.  */
    if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
      {
!       RUN_PASS (regmove, ());
        ggc_collect ();
      }
  
    /* Do unconditional splitting before register allocation to allow machine
       description to add extra information not needed previously.  */
!   RUN_PASS (split_insns, ());
  
  #ifdef OPTIMIZE_MODE_SWITCHING
!   RUN_PASS (optimize_mode_switching, ());
  #endif
  
    timevar_push (TV_SCHED);
*************** rest_of_compilation (decl)
*** 3410,3433 ****
        if (flag_superblock_scheduling)
  	{
  	  if (!flag_trace_scheduling)
! 	    reorder_basic_blocks ();
  	  else
! 	    tracer ();
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
! 	  schedule_ebbs (rtl_dump_file);
! 	  /* No liveness updating code yet, but it should be easy to do  */
! 	  count_or_remove_death_notes (NULL, 1);
! 	  life_analysis (get_insns (), rtl_dump_file, PROP_FINAL);
  	}
        else
  #endif
  	schedule_insns (rtl_dump_file);
  
!       close_dump_file (DFI_sched, print_rtl_with_bb, insns);
! 
!       /* Register lifetime information was updated as part of verifying
! 	 the schedule.  */
!       register_life_up_to_date = 1;
      }
  #endif
    timevar_pop (TV_SCHED);
--- 3149,3166 ----
        if (flag_superblock_scheduling)
  	{
  	  if (!flag_trace_scheduling)
! 	    RUN_PASS (reorder_basic_blocks, ());
  	  else
! 	    RUN_PASS (tracer, ());
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE, 0));
! 	  RUN_PASS (ebb_scheduler, ());
! 	  RUN_PASS (life_analysis, (PROP_FINAL));
  	}
        else
  #endif
  	schedule_insns (rtl_dump_file);
  
!       close_dump_file (DFI_sched, print_rtl_with_bb, get_insns ());
      }
  #endif
    timevar_pop (TV_SCHED);
*************** rest_of_compilation (decl)
*** 3447,3519 ****
       RUN_JUMP_AFTER_RELOAD records whether or not we need to rerun the
       jump optimizer after register allocation and reloading are finished.  */
  
-   if (! register_life_up_to_date)
-     recompute_reg_usage (insns, ! optimize_size);
- 
    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);
--- 3180,3236 ----
       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)
      {
!       RUN_PASS (trivial_dce, ());
!       RUN_PASS (reg_alloc, ());
!       REQ_STRUCTURE (reg_equiv_memory_loc, OK);
!       RUN_PASS (regclass, ());
  
        timevar_pop (TV_LOCAL_ALLOC);
!       close_dump_file (DFI_lreg, NULL, NULL);
  
        /* XXX clean up the whole mess to bring live info in shape again.  */
        timevar_push (TV_GLOBAL_ALLOC);
        open_dump_file (DFI_greg, decl);
  
!       failure = RUN_PASS (reload, (0));
  
        timevar_pop (TV_GLOBAL_ALLOC);
  
!       if (rtl_dump_file)
! 	dump_global_regs (rtl_dump_file);
! 
!       close_dump_file (DFI_greg, print_rtl_with_bb, get_insns ());
  
        if (failure)
          goto exit_rest_of_compilation;
        rebuild_label_notes_after_reload = 0;
      }
    else
      {
!       REQ_STRUCTURE (reg_equiv_memory_loc, OK);
  
!       /* Allocate the reg_renumber array.  */
!       allocate_reg_info (max_reg_num (), FALSE, TRUE);
  
!       RUN_PASS (regclass, ());
!       rebuild_label_notes_after_reload = RUN_PASS (local_alloc, ());
  
!       /* Local_alloc clobbers register usage, but we do not want to
! 	 recount it now.  */
!       FORCE_STRUCTURE (register_usage, OK);
  
        timevar_pop (TV_LOCAL_ALLOC);
  
!       if (rtl_dump_file)
  	{
  	  dump_flow_info (rtl_dump_file);
  	  dump_local_alloc (rtl_dump_file);
  	}
  
+       close_dump_file (DFI_lreg, print_rtl_with_bb, get_insns ());
+ 
        ggc_collect ();
  
        timevar_push (TV_GLOBAL_ALLOC);
*************** rest_of_compilation (decl)
*** 3523,3546 ****
  	 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;
--- 3240,3255 ----
  	 pass fixing up any insns that are invalid.  */
  
        if (optimize)
! 	failure = RUN_PASS (global_alloc, ());
        else
! 	failure = RUN_PASS (reload, (0));
  
        timevar_pop (TV_GLOBAL_ALLOC);
  
!       if (rtl_dump_file)
! 	dump_global_regs (rtl_dump_file);
  
!       close_dump_file (DFI_greg, print_rtl_with_bb, get_insns ());
  
        if (failure)
  	goto exit_rest_of_compilation;
*************** rest_of_compilation (decl)
*** 3548,3562 ****
  
    ggc_collect ();
  
-   open_dump_file (DFI_postreload, decl);
- 
    /* Do a very simple CSE pass over just the hard registers.  */
    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
--- 3257,3265 ----
  
    ggc_collect ();
  
    /* Do a very simple CSE pass over just the hard registers.  */
    if (optimize > 0)
!     RUN_PASS (cse_post_reload, ());
  
    /* Register allocation and reloading may have turned an indirect jump into
       a direct jump.  If so, we must rebuild the JUMP_LABEL fields of
*************** rest_of_compilation (decl)
*** 3565,3578 ****
      {
        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);
    open_dump_file (DFI_flow2, decl);
--- 3268,3279 ----
      {
        timevar_push (TV_JUMP);
  
!       rebuild_jump_labels (get_insns ());
        purge_all_dead_edges (0);
  
        timevar_pop (TV_JUMP);
      }
  
    /* Re-create the death notes which were deleted during reload.  */
    timevar_push (TV_FLOW2);
    open_dump_file (DFI_flow2, decl);
*************** rest_of_compilation (decl)
*** 3583,3603 ****
  
    /* 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
--- 3284,3305 ----
  
    /* If optimizing, then go ahead and split insns now.  */
    if (optimize > 0)
!     RUN_PASS (split_insns, ());
  
!   RUN_PASS (cfg_cleanup, (optimize ? CLEANUP_EXPENSIVE : 0, 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.  */
!   RUN_PASS (add_prologue_and_epilogue, ());
  
    if (optimize)
      {
!       RUN_PASS (life_analysis, (PROP_FINAL));
!       RUN_PASS (cfg_cleanup,
! 		(CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! 	      	 | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0), 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)
*** 3606,3632 ****
  #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
    if (optimize > 0 && flag_peephole2)
!     {
!       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
  
    if (optimize > 0 && (flag_rename_registers || flag_cprop_registers))
--- 3308,3326 ----
  #ifndef PUSH_ROUNDING
        if (!ACCUMULATE_OUTGOING_ARGS)
  #endif
! 	RUN_PASS (combine_stack_adjustments, ());
  
        ggc_collect ();
      }
  
    flow2_completed = 1;
  
!   close_dump_file (DFI_flow2, print_rtl_with_bb, get_insns ());
    timevar_pop (TV_FLOW2);
  
  #ifdef HAVE_peephole2
    if (optimize > 0 && flag_peephole2)
!     RUN_PASS (peephole2, ());
  #endif
  
    if (optimize > 0 && (flag_rename_registers || flag_cprop_registers))
*************** rest_of_compilation (decl)
*** 3635,3661 ****
        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);
      }
  
    if (flag_if_conversion2)
      {
-       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
--- 3329,3353 ----
        open_dump_file (DFI_rnreg, decl);
  
        if (flag_rename_registers)
! 	RUN_PASS (register_renaming, ());
        if (flag_cprop_registers)
! 	RUN_PASS (copyprop_hardreg_forward, ());
  
!       close_dump_file (DFI_rnreg, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_RENAME_REGISTERS);
      }
  
    if (flag_if_conversion2)
      {
        open_dump_file (DFI_ce3, decl);
  
!       RUN_PASS (if_conversion, (1, TV_IFCVT2));
  
!       close_dump_file (DFI_ce3, print_rtl_with_bb, get_insns ());
      }
  #ifdef STACK_REGS
    if (optimize)
!     RUN_PASS (split_insns, ());
  #endif
  
  #ifdef INSN_SCHEDULING
*************** rest_of_compilation (decl)
*** 3667,3691 ****
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
!       split_all_insns (1);
!       cleanup_cfg (CLEANUP_EXPENSIVE);
  
        if (flag_superblock_scheduling)
  	{
  	  if (!flag_trace_scheduling)
! 	    reorder_basic_blocks ();
  	  else
! 	    tracer ();
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
! 	  schedule_ebbs (rtl_dump_file);
! 	  /* No liveness updating code yet, but it should be easy to do  */
! 	  count_or_remove_death_notes (NULL, 1);
! 	  life_analysis (get_insns (), rtl_dump_file, PROP_DEATH_NOTES);
! 	  cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! 		       | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
  	}
        else
! 	schedule_insns (rtl_dump_file);
  
        close_dump_file (DFI_sched2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_SCHED2);
--- 3359,3382 ----
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
!       RUN_PASS (split_insns, ());
!       RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
  
        if (flag_superblock_scheduling)
  	{
  	  if (!flag_trace_scheduling)
! 	    RUN_PASS (reorder_basic_blocks, ());
  	  else
! 	    RUN_PASS (tracer, ());
! 	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE, 0));
! 	  RUN_PASS (ebb_scheduler, ());
! 	  RUN_PASS (life_analysis, (PROP_DEATH_NOTES));
! 	  RUN_PASS (cfg_cleanup,
! 		    (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! 		     | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0), 0));
  	}
        else
! 	RUN_PASS (schedule_insns, ());
  
        close_dump_file (DFI_sched2, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_SCHED2);
*************** rest_of_compilation (decl)
*** 3700,3714 ****
  #endif
  
  #ifdef STACK_REGS
!   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 ();
  #endif
    if (optimize > 0)
      {
--- 3391,3397 ----
  #endif
  
  #ifdef STACK_REGS
!   RUN_PASS (regstack, ());
  #endif
    if (optimize > 0)
      {
*************** rest_of_compilation (decl)
*** 3719,3767 ****
  	 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 ();
  
    if (flag_var_tracking)
      {
!       /* Track the variables, ie. compute where the variable is stored
!        in each position in function.  */
!       timevar_push (TV_VAR_TRACKING);
!       open_dump_file (DFI_vartrack, decl);
! 
!       variable_tracking_main ();
! 
!       close_dump_file (DFI_vartrack, print_rtl_with_bb, get_insns ());
!       timevar_pop (TV_VAR_TRACKING);
!     }
!  
!   /* CFG is no longer maintained up-to-date.  */
!   free_bb_for_insn ();
  
    /* If a machine dependent reorganization is needed, call it.  */
  #ifdef MACHINE_DEPENDENT_REORG
    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,
--- 3402,3451 ----
  	 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.  */
!       RUN_PASS (cfg_cleanup,
! 		(CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
! 	      	 | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0), 0));
        if (flag_reorder_blocks)
  	{
! 	  RUN_PASS (reorder_basic_blocks, ());
! 	  RUN_PASS (cfg_cleanup,
! 		    (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK, 0));
  	}
  
!       close_dump_file (DFI_bbro, print_rtl_with_bb, get_insns ());
        timevar_pop (TV_REORDER_BLOCKS);
      }
  
+   RUN_PASS (compute_alignments, ());
+ 
+   /* Track the variables, ie. compute where the variable is stored
+      in each position in function.  */
    if (flag_var_tracking)
+     RUN_PASS (var_tracking, ());
+ 
+   /* Stop tracking structures.  */
+   if (tracking_structures)
      {
!       if (optimize > 0)
! 	REQ_STRUCTURE (death_notes, OK);
!       finish_structures ();
!     }
!   tracking_structures = 0;
  
    /* If a machine dependent reorganization is needed, call it.  */
  #ifdef MACHINE_DEPENDENT_REORG
    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)
*** 3773,3781 ****
        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 ();
--- 3457,3465 ----
        timevar_push (TV_DBR_SCHED);
        open_dump_file (DFI_dbr, decl);
  
!       dbr_schedule (get_insns (), rtl_dump_file);
  
!       close_dump_file (DFI_dbr, print_rtl, get_insns ());
        timevar_pop (TV_DBR_SCHED);
  
        ggc_collect ();
*************** rest_of_compilation (decl)
*** 3820,3827 ****
      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
--- 3504,3511 ----
      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
*************** rest_of_compilation (decl)
*** 3867,3872 ****
--- 3551,3561 ----
  
   exit_rest_of_compilation:
  
+   /* Stop tracking structures.  */
+   if (tracking_structures)
+     finish_structures ();
+   tracking_structures = 0;
+   
    /* In case the function was not output,
       don't leave any temporary anonymous types
       queued up for sdb output.  */
Index: toplev.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.h,v
retrieving revision 1.89.2.1
diff -c -3 -p -r1.89.2.1 toplev.h
*** toplev.h	28 Jan 2003 22:47:47 -0000	1.89.2.1
--- toplev.h	6 Feb 2003 16:45:07 -0000
*************** extern void _fatal_insn			PARAMS ((const
*** 45,50 ****
--- 45,102 ----
  						const char *, int,
  						const char *))
  					      ATTRIBUTE_NORETURN;
+ /* 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_vpt,
+   DFI_ce1,
+   DFI_tracer,
+   DFI_loop2,
+   DFI_web,
+   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_vartrack,
+   DFI_mach,
+   DFI_dbr,
+   DFI_MAX
+ };
+ 
+ extern tree current_decl;
+ 
+ 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));
  
  #define fatal_insn(msgid, insn) \
  	_fatal_insn (msgid, insn, __FILE__, __LINE__, __FUNCTION__)
Index: tracer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tracer.c,v
retrieving revision 1.3.2.6
diff -c -3 -p -r1.3.2.6 tracer.c
*** tracer.c	4 Feb 2003 16:32:46 -0000	1.3.2.6
--- tracer.c	6 Feb 2003 16:45:07 -0000
*************** layout_superblocks ()
*** 372,382 ****
  
  /* 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)
--- 372,382 ----
  
  /* 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 ()
*** 386,389 ****
--- 386,390 ----
    if (rtl_dump_file)
      dump_flow_info (rtl_dump_file);
    cfg_layout_finalize ();
+   return true;
  }
Index: web.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/web.c,v
retrieving revision 1.1.4.2
diff -c -3 -p -r1.1.4.2 web.c
*** web.c	6 Feb 2003 10:03:38 -0000	1.1.4.2
--- web.c	6 Feb 2003 16:45:07 -0000
*************** web_main ()
*** 313,319 ****
  					      used, use_addressof));
  
    /* Dataflow information is corrupt here, but it can be easy to update it
!      by creating new entries for new registers and update or calilng
       df_insns_modify.  */
    free (def_entry);
    free (use_entry);
--- 313,319 ----
  					      used, use_addressof));
  
    /* Dataflow information is corrupt here, but it can be easy to update it
!      by creating new entries for new registers and update or calling
       df_insns_modify.  */
    free (def_entry);
    free (use_entry);
-------------- next part --------------
/* passes.def -- definitions of passes 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.

*/

/* Definition of a pass is made through DEF_PASS macro
   with following arguments:

     -- identifier of the pass
     -- name of the pass
     -- brief description (for no real purpose, just to make things more
        readable
     -- types of parameters
     -- names of parameters
     -- their types in format of function header
     -- type of return value
     -- name of return value
     -- a piece of initialization code (may access the parameters and
        should contain list of requirements using macros described in
	structures.def)
     -- a piece of finalization code (may access the parameters and
	return value.  Should contain list of actions using macros described
	in structures.def and below determining final state of structures).
     -- a piece of execution code (may access the parameters and should
        return value of appropriate type)

   The following macros are defined in passes.h:

   PRESERVE_STRUCTURE (id)

   tells us to preserve structure ID even if it is fragile
   
   PRESERVE_ALL_STRUCTURES

   tells us to preserve all structures, even if they are fragile (it should
   only be used if nothing was changed at all)

   REQ_DEFAULT_STRUCTURES

   may be used to specify the common state of structures most of passes
   require

   BEGIN_PASS (id, (params))

   runs the initialization for a pass.  It starts a block.

   END_PASS (id, (params), return_value)
   
   runs the finalization for a pass. It ends a block.

   RUN_PASS (id, (params))

   runs the whole pass (i.e. including BEGIN_PASS & END_PASS; returns the
   return value)

   There are two ways you may run a pass:

   For simple self-contained passes, just use RUN_PASS with appropriate
   parameters.

   For more complicated passes, use following construction:

   BEGIN_PASS (id, (params));
   body of a pass
   END_PASS (id, (params), return_value);

   (it is not currently used anywhere, so it is not tested at all)
   */

DEF_PASS (delete_unreachable_blocks, "removal of unreachable blocks",
	  "Removes the blocks unreachable from origin from CFG.",
	  (void), (),,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return delete_unreachable_blocks ();)

DEF_PASS (lower_prediction_notes, "lowering of prediction notes",
	  "Turn NOTE_INSN_PREDICTIONs into branch predictions.",
	  (void), (),,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (TV_BRANCH_PROB);
	  ,
	  timevar_pop (TV_BRANCH_PROB);
	  ,
	  note_prediction_to_br_prob ();
	  return 0;)

DEF_PASS (tail_recursion_optimalization, "turning tail recusion into iteration",
	  "Turns tail recursion into iteration.",
	  (void), (),,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  RUN_PASS (cfg_cleanup, (CLEANUP_PRE_SIBCALL | CLEANUP_PRE_LOOP, 0));
	  ,
	  FORCE_STRUCTURE (cfg, DIRTY);
	  ,
	  optimize_sibling_and_tail_recursive_calls ();
	  return 0;)

DEF_PASS (cfg_cleanup, "cleaning up cfg",
	  "Does various cfg level optimalizations.",
	  (int, int), (flags, do_dump),
	  int flags ATTRIBUTE_UNUSED;
	  int do_dump ATTRIBUTE_UNUSED;,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  if (!cfg_cleanup_unnecessary_p (flags))
	    {
	      if ((flags & CLEANUP_UPDATE_LIFE)
		  && STATE_OF_STRUCTURE (liveness) == SS_NONE)
		REQ_STRUCTURE (liveness, OK);
	    }
	  timevar_push (TV_CLEANUP_CFG);
	  ,
	  timevar_pop (TV_CLEANUP_CFG);
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  if (!cfg_cleanup_unnecessary_p (flags))
	    {
	      FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, OK);
	      PRESERVE_STRUCTURE (nothing_changed_since_last_cfg_cleanup);
	      last_cfg_cleanup_flags = flags;
	    }
	  ,
	  /* If nothing has changed and we are called with subset of its
	     flags, do not bother to do the cleanup.  */
	  if (cfg_cleanup_unnecessary_p (flags))
	    return false;
	  if (do_dump && rtl_dump_file)
	    dump_flow_info (rtl_dump_file);
	  return cleanup_cfg (flags);)

DEF_PASS (finish_eh_generation, "finishing generation of exception handling code",
	  "Finishes generation of exception handling code.",
	  (void), (),,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (TV_JUMP);
	  open_dump_file (DFI_eh, current_decl);
	  ,
	  close_dump_file (DFI_eh, print_rtl, get_insns ());
	  timevar_pop (TV_JUMP);
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    FORCE_STRUCTURE (cfg, DIRTY);
	  ,
	  return finish_eh_generation ();)

#ifdef SETJMP_VIA_SAVE_AREA
DEF_PASS (optimize_save_area_alloca, "optimizing alloca when SETJMP_VIA_SAVE_AREA.",
	  "Optimize RTL generated by allocate_dynamic_stack_space for targets where SETJMP_VIA_SAVE_AREA.",
	  (void), (),,
	  int, none_really,
	  ,
	  ,
	  optimize_save_area_alloca (get_insns ());
	  return 0;)
#endif

DEF_PASS (lower_expected_value_notes, "lowering of NOTE_INSN_EXPECTED_VALUE notes",
	  "Turn NOTE_INSN_EXPECTED_VALUEs into branch predictions.",
	  (void), (),,
	  int, none_really,
	  ,
	  ,
	  expected_value_to_br_prob ();
	  return 0;)

DEF_PASS (copy_loop_headers, "copying headers of loops",
	  "Copy exit tests of loops.",
	  (void), (),,
	  bool, changed,
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    FORCE_STRUCTURE (cfg, DIRTY);
	  ,
	  return copy_loop_headers (get_insns ());)

DEF_PASS (ssa_ccp, "SSA conditional constant propagation",
	  "Conditional constant propagation on SSA.",
	  (void), (),,
	  int, none_really,
	  REQ_STRUCTURE (ssa, OK);
	  timevar_push (TV_SSA_CCP);
	  open_dump_file (DFI_ssa_ccp, current_decl);
	  /* We need alias analysis (for what?) */
	  REQ_STRUCTURE (alias_info, OK);
	  ,
	  close_dump_file (DFI_ssa_ccp, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_SSA_CCP);
	  ,
	  ssa_const_prop ();
	  return 0;)

DEF_PASS (ssa_dce, "SSA dead code elimination",
	  "Dead code elimination on SSA.",
	  (void), (),,
	  int, none_really,
	  REQ_STRUCTURE (ssa, OK);
	  timevar_push (TV_SSA_DCE);
	  open_dump_file (DFI_ssa_dce, current_decl);
	  ,
	  close_dump_file (DFI_ssa_dce, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_SSA_DCE);
	  ,
	  ssa_eliminate_dead_code ();
	  return 0;)

DEF_PASS (delete_null_pointer_checks, "deleting useless null pointer tests",
	  "Delete useless null pointer tests.",
	  (void), (),,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  open_dump_file (DFI_null, current_decl);
	  if (rtl_dump_file)
	    dump_flow_info (rtl_dump_file);
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    {
	      FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	      RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP, 0));
	    }
	  close_dump_file (DFI_null, print_rtl_with_bb, get_insns ());
	  ,
	  return delete_null_pointer_checks (get_insns ());)

DEF_PASS (cse, "eliminating common subexpressions",
	  "Common subexpression elimination.",
	  (int), (after_loop), int after_loop ATTRIBUTE_UNUSED;,
	  bool, jumps_changed,
	  reg_scan (get_insns (), max_reg_num (), 1);
	  REQ_STRUCTURE (alias_info, OK);
	  ,
  	  if (jumps_changed)
	    rebuild_jump_labels (get_insns ());
	  purge_all_dead_edges (0);
	  RUN_PASS (trivial_dce, ());
	  ,
	  return cse_main (get_insns (), max_reg_num (), after_loop, rtl_dump_file);
	  )

DEF_PASS (gcse, "running gcse",
	  "Global common subexpression elimination.",
	  (void), (),,
	  bool, jumps_changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  rebuild_jump_labels (get_insns ());
	  delete_trivially_dead_insns (get_insns (), max_reg_num ());
	  ,
	  return gcse_main (get_insns (), rtl_dump_file);
	  )

DEF_PASS (delete_dead_jumptables, "removal of dead jumptables",
	  "Removes the jump tables that are never referenced.",
	  (void), (),,
	  bool, changed,
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return delete_dead_jumptables ();)

DEF_PASS (old_loop_optimizer, "optimizing loops",
	  "Moves invariants out of loops and various other loop optimizations.",
	  (int), (flags), int flags ATTRIBUTE_UNUSED;,
	  int, none_really,
	  /* CFG is not updated.  */
	  REQ_STRUCTURE (cfg, NONE);
	  ,
	  ,
	  loop_optimize (get_insns (), rtl_dump_file, flags);
	  return 0;)

DEF_PASS (bypass_jumps, "jump bypassing",
	  "Jump bypassing and control flow optimizations.",
	  (void), (), ,
	  int, jumps_changed,
	  REQ_STRUCTURE (cfg, OK);
	  timevar_push (TV_BYPASS);
	  open_dump_file (DFI_bypass, current_decl);
	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
	  ,
	  if (jumps_changed)
	    {
	      rebuild_jump_labels (get_insns ());
	      FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	      RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
	      RUN_PASS (trivial_dce, ());
	    }

	  close_dump_file (DFI_bypass, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_BYPASS);
	  ,
	  return bypass_jumps (rtl_dump_file);)

DEF_PASS (trivial_dce, "deleting trivially dead insns",
	  "Deletes sets that are never used.",
	  (void), (), ,
	  int, ndead,
	  timevar_push (TV_DELETE_TRIVIALLY_DEAD);
	  ,
	  timevar_pop (TV_DELETE_TRIVIALLY_DEAD);
	  if (!ndead)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return delete_trivially_dead_insns (get_insns (), max_reg_num ());)

DEF_PASS (mark_constant_function, "marking function constant",
	  "Marks constant function.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  PRESERVE_ALL_STRUCTURES;
	  ,
	  mark_constant_function ();
	  return 0;)

DEF_PASS (branch_prob, "analyzing program profile",
	  "Instruments program and/or analyzes its behavior according to profile.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!profile_arc_flag)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  if (flag_value_histograms)
	    {
	      /* Mark unused registers.  This is needed to turn divmods back into
		 corresponding divs/mods.  */
	      REQ_STRUCTURE (death_notes, OK);
	    }
	  branch_prob ();
	  return 0;)

DEF_PASS (profile_estimation, "estimating function profile",
	  "Estimates function profile from its properties.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (loops, OK);
	  if (rtl_dump_file)
	    flow_loops_dump (&loop_tree, rtl_dump_file, NULL, 0);
	  ,
	  REQ_STRUCTURE (loops, NONE);
	  PRESERVE_ALL_STRUCTURES;
	  ,
	  estimate_probability (&loop_tree);
	  return 0;)

DEF_PASS (vpt, "value profile transformations",
	  "Optimizations based on value profile.",
	  (void), (), ,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (death_notes, OK);
	  open_dump_file (DFI_vpt, current_decl);
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    {
	      FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	      RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
	      FORCE_STRUCTURE (liveness, DIRTY);
	      FORCE_STRUCTURE (death_notes, DIRTY);
	    }
	  close_dump_file (DFI_vpt, print_rtl_with_bb, get_insns ());
	  ,
	  return value_profile_transformations ();)

DEF_PASS (if_conversion, "converting ifs",
	  "Various optimizations on simple if conditions.",
	  (int, timevar_id_t), (life_data_ok, timevar_id),
	  int life_data_ok ATTRIBUTE_UNUSED;
	  timevar_id_t timevar_id ATTRIBUTE_UNUSED;,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (timevar_id);
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else if (!life_data_ok)
	    {
	      FORCE_STRUCTURE (liveness, DIRTY);
	      FORCE_STRUCTURE (death_notes, DIRTY);
	    }
	  timevar_pop (timevar_id);
	  ,
	  return if_convert (life_data_ok);)

DEF_PASS (tracer, "tail duplication",
	  "Tail duplication and superblock formation.",
	  (void), (), ,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return tracer ();)

DEF_PASS (unswitch_loops, "loop unswitching",
	  "Moving invariant branches out of loops.",
	  (void), (), ,
	  bool, changed,
	  REQ_STRUCTURE (loops_for_loop2, OK);
	  ,
	  PRESERVE_STRUCTURE (loops_for_loop2);
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  if (loop_tree.num > 1)
	    return unswitch_loops (&loop_tree);
	  else
	    return false;
	  )

DEF_PASS (unroll_and_peel_loops, "loop unrolling and peeling",
	  "Unrolls and/or peels loops.",
	  (int), (flags), int flags ATTRIBUTE_UNUSED;,
	  bool, changed,
	  REQ_STRUCTURE (loops_for_loop2, OK);
	  ,
	  PRESERVE_STRUCTURE (loops_for_loop2);
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  if (loop_tree.num > 1)
	    return unroll_and_peel_loops (&loop_tree, flags);
	  else
	    return false;
	  )

DEF_PASS (webizer, "webizer",
	  "Split independent uses of pseudos.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  open_dump_file (DFI_web, current_decl);
	  timevar_push (TV_WEB);
	  RUN_PASS (cfg_cleanup, (0, 0));
	  ,
	  RUN_PASS (trivial_dce, ());
	  FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));

	  timevar_pop (TV_WEB);
	  close_dump_file (DFI_web, print_rtl_with_bb, get_insns ());
	  reg_scan (get_insns (), max_reg_num (), 0);
	  ,
	  web_main ();
	  return 0;)

DEF_PASS (life_analysis, "life analysis",
	  "Computes liveness and depending on flags does a bunch of other unrelated tasks.",
	  (int), (flags), int flags ATTRIBUTE_UNUSED;,
	  int, none_really,
	  REQ_STRUCTURE (cfg, OK);
	  if (! optimize)
	    flags &= ~(PROP_LOG_LINKS | PROP_AUTOINC | PROP_ALLOW_CFG_CHANGES);

	  /* The post-reload life analysis have (on a global basis) the same
	     registers live as was computed by reload itself.  elimination
      	     Otherwise offsets and such may be incorrect.

	     Reload will make some registers as live even though they do not
	     appear in the rtl.

	     We don't want to create new auto-incs after reload, since they
	     are unlikely to be useful and can cause problems with shared
	     stack slots.  */
	  if (reload_completed)
	    flags &= ~(PROP_REG_INFO | PROP_AUTOINC);

	  if (flags & PROP_DEATH_NOTES)
	    count_or_remove_death_notes (NULL, 1);

	  /* We want alias analysis information for local dead store
	     elimination.  */
	  if (optimize && (flags & PROP_SCAN_DEAD_STORES))
	    REQ_STRUCTURE (alias_info, OK);

	  /* Always remove no-op moves.  Do this before other processing so
	     that we don't have to keep re-scanning them.  */
	  RUN_PASS (delete_noop_moves, ());
	  ,
	  if (rtl_dump_file)
	    dump_flow_info (rtl_dump_file);

	  /* Removing dead insns should've made jumptables really dead.  */
	  RUN_PASS (delete_dead_jumptables, ());

	  /* This pass affects varius structures.  */
	  if (flags & PROP_DEATH_NOTES)
	    {
	      FORCE_STRUCTURE (liveness, OK);
	      FORCE_STRUCTURE (death_notes, OK);
	    }
	  if (flags & PROP_REG_INFO)
	    {
	      FORCE_STRUCTURE (register_usage, OK);
	      PRESERVE_STRUCTURE (register_usage);
	    }
	  if (flags & PROP_LOG_LINKS)
	    {
	      FORCE_STRUCTURE (log_links, OK);
	      PRESERVE_STRUCTURE (log_links);
	    }
	  if (!(flags & PROP_KILL_DEAD_CODE))
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  life_analysis (get_insns (), rtl_dump_file, flags);
	  return 0;)

DEF_PASS (delete_noop_moves, "removing noop moves",
	  "Deletes any insns that copy a register to itself.",
	  (void), (), ,
	  int, n_removed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!n_removed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return delete_noop_moves (get_insns ());
	  )

DEF_PASS (initialize_uninitialized_subregs, "initialize uninitialized subregs",
	  "Set uninitialized subregs to 0.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    {
	      FORCE_STRUCTURE (liveness, DIRTY);
	      FORCE_STRUCTURE (death_notes, DIRTY);
	    }
	  ,
	  return initialize_uninitialized_subregs ();
	  )

DEF_PASS (combine_instructions, "combine instructions",
	  "Try to combine groups of instructions.",
	  (void), (), ,
	  int, jumps_changed,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  REQ_STRUCTURE (death_notes, OK);

	  timevar_push (TV_COMBINE);
	  open_dump_file (DFI_combine, current_decl);
	  REQ_STRUCTURE (log_links, OK);
	  ,
	  /* Combining insns may have turned an indirect jump into a
	     direct jump.  Rebuid the JUMP_LABEL fields of jumping
	     instructions.  */
	  if (jumps_changed)
	    {
	      timevar_push (TV_JUMP);
	      rebuild_jump_labels (get_insns ());
	      timevar_pop (TV_JUMP);

	      FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	      RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE, 0));
      	    }

	  close_dump_file (DFI_combine, print_rtl_with_bb, get_insns ());
    	  timevar_pop (TV_COMBINE);
	  ,
	  return combine_instructions (get_insns (), max_reg_num ());
	  )

DEF_PASS (ebb_scheduler, "extended basic block scheduler",
	  "Schedule insns in extended basic blocks.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  FORCE_STRUCTURE (liveness, DIRTY);
	  FORCE_STRUCTURE (death_notes, DIRTY);
	  ,
	  schedule_ebbs (rtl_dump_file);
	  return 0;
	  )

DEF_PASS (dce, "dead code elimination",
	  "Dead code ellimination using liveness.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  FORCE_STRUCTURE (liveness, OK);
	  FORCE_STRUCTURE (death_notes, OK);
	  ,
	  return update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
      						   PROP_DEATH_NOTES
						   | PROP_SCAN_DEAD_CODE
						   | PROP_KILL_DEAD_CODE);
	  )

DEF_PASS (split_insns, "insn splitting",
	  "Split all insns in the function.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  else
	    FORCE_STRUCTURE (death_notes, DIRTY);
	  ,
	  return split_all_insns ();
	  )

DEF_PASS (peephole2, "peephole 2",
	  "Peephole 2 pass.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  timevar_push (TV_PEEPHOLE2);
	  open_dump_file (DFI_peephole2, current_decl);
	  ,
	  if (!(changed & 4))
	    PRESERVE_ALL_STRUCTURES;
	  if (changed & 2)
	    FORCE_STRUCTURE (liveness, DIRTY);
	  if (changed & 1)
	    FORCE_STRUCTURE (death_notes, DIRTY);
	  close_dump_file (DFI_peephole2, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_PEEPHOLE2);
	  ,
	  return peephole2_optimize (rtl_dump_file);
	  )

DEF_PASS (register_renaming, "register renaming",
	  "Register renaming.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  FORCE_STRUCTURE (liveness, DIRTY);
	  FORCE_STRUCTURE (death_notes, DIRTY);
	  ,
	  regrename_optimize ();
	  return 0;
	  )

DEF_PASS (regmove, "regmove optimization",
	  "Move registers around to reduce number of move instructions needed.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (TV_REGMOVE);
	  open_dump_file (DFI_regmove, current_decl);

	  REQ_STRUCTURE (log_links, OK);
	  ,
	  FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	  RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE, 0));
	  close_dump_file (DFI_regmove, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_REGMOVE);
	  ,
	  regmove_optimize (get_insns (), max_reg_num (), rtl_dump_file);
	  return 0;
	  )

DEF_PASS (optimize_mode_switching, "optimize mode switching",
	  "Insert mode switches.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  timevar_push (TV_MODE_SWITCH);

	  no_new_pseudos = 0;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  no_new_pseudos = 1;

	  timevar_pop (TV_MODE_SWITCH);
	  ,
	  return optimize_mode_switching (NULL);
	  )

DEF_PASS (reorder_basic_blocks, "basic blocks reordering",
	  "Reorder basic blocks.",
	  (void), (), ,
	  int, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return reorder_basic_blocks ();
	  )

DEF_PASS (reg_alloc, "register allocation",
	  "Graph coloring based register allocator.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (register_usage, OK);
	  ,
	  ,
	  reg_alloc ();
	  return 0;
	  )

DEF_PASS (reload, "reload",
	  "Reload pseudo regs into hard regs.",
	  (int), (global), int global ATTRIBUTE_UNUSED;,
	  int, failure,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  REQ_STRUCTURE (death_notes, OK);
	  build_insn_chain (get_insns ());
	  ,
	  REQ_STRUCTURE (reg_equiv_memory_loc, NONE);
	  FORCE_STRUCTURE (liveness, DIRTY);
	  FORCE_STRUCTURE (death_notes, DIRTY);
	  ,
	  return reload (get_insns (), global);
	  )

DEF_PASS (regclass, "regclass",
	  "Compute register class preferences for pseudo-registers.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  REQ_STRUCTURE (death_notes, OK);
	  REQ_STRUCTURE (register_usage, OK);
	  ,
	  PRESERVE_ALL_STRUCTURES;
	  ,
	  regclass (get_insns (), max_reg_num (), rtl_dump_file);
	  return 0;
	  )

DEF_PASS (local_alloc, "local register allocation",
	  "Allocate registers within a basic block.",
	  (void), (), ,
	  int, labels_altered,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  REQ_STRUCTURE (death_notes, OK);
	  REQ_STRUCTURE (register_usage, OK);
	  ,
	  ,
	  return local_alloc ();
	  )

DEF_PASS (global_alloc, "global register allocation",
	  "Allocate registers for pseudo-registers that span basic blocks.",
	  (void), (), ,
	  int, failure,
	  REQ_DEFAULT_STRUCTURES;
	  REQ_STRUCTURE (liveness, OK);
	  REQ_STRUCTURE (death_notes, OK);
	  REQ_STRUCTURE (register_usage, OK);
	  ,
	  ,
	  return global_alloc (rtl_dump_file);
	  )

DEF_PASS (cse_post_reload, "post-reload cse pass",
	  "Call cse / combine like post-reload optimization phases.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  /* In fact we should require liveness OK here; but it would slow
	     things down unnecesarily, so just let it be like this for now.  */
	  timevar_push (TV_RELOAD_CSE_REGS);
	  open_dump_file (DFI_postreload, current_decl);
	  ,
	  close_dump_file (DFI_postreload, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_RELOAD_CSE_REGS);
	  ,
	  reload_cse_regs (get_insns ());
	  return 0;
	  )

DEF_PASS (add_prologue_and_epilogue, "add prologue and epilogue code",
	  "Add prologue and epilogue code represented as RTL.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  ,
	  thread_prologue_and_epilogue_insns (get_insns ());
	  return 0;
	  )

DEF_PASS (combine_stack_adjustments, "combine stack adjustments",
	  "Combine stack adjustments.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  ,
	  combine_stack_adjustments ();
	  return 0;
	  )

DEF_PASS (copyprop_hardreg_forward, "forward hardreg copy propagation",
	  "Forward hardreg copy propagation.",
	  (void), (), ,
	  bool, changed,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  if (!changed)
	    PRESERVE_ALL_STRUCTURES;
	  ,
	  return copyprop_hardreg_forward ();
	  )

DEF_PASS (schedule_insns, "instruction scheduling",
	  "Instruction scheduling.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  ,
	  schedule_insns (rtl_dump_file);
	  return 0;
	  )

DEF_PASS (regstack, "register to stack conversion",
	  "Convert stack-like registers to flat ones.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (TV_REG_STACK);
	  open_dump_file (DFI_stack, current_decl);
	  ,
	  close_dump_file (DFI_stack, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_REG_STACK);
	  ggc_collect ();
	  ,
	  reg_to_stack (get_insns (), rtl_dump_file);
	  return 0;
	  )

DEF_PASS (compute_alignments, "compute label alignments",
	  "Compute alignments of labels.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  ,
	  ,
	  compute_alignments ();
	  return 0;
	  )

DEF_PASS (var_tracking, "variable tracking",
	  "Variable tracking.",
	  (void), (), ,
	  int, none_really,
	  REQ_DEFAULT_STRUCTURES;
	  timevar_push (TV_VAR_TRACKING);
	  open_dump_file (DFI_vartrack, current_decl);
	  ,
	  close_dump_file (DFI_vartrack, print_rtl_with_bb, get_insns ());
	  timevar_pop (TV_VAR_TRACKING);
	  PRESERVE_ALL_STRUCTURES;
	  ,
	  variable_tracking_main ();
	  return 0;
	  )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: passes.c
Type: text/x-csrc
Size: 7308 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030206/d84041cb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: passes.h
Type: text/x-chdr
Size: 7585 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030206/d84041cb/attachment-0001.bin>
-------------- next part --------------
/* structures.def -- definitions of 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.

*/

/* Definition of internal structure is made through DEF_STRUCTURE macro
   with following arguments:

     -- identifier of the structure
     -- name of the structure
     -- brief description (for no real purpose, just to make things more
        readable
     -- initial state:
           NONE -- does not exist
	   DIRTY -- the structure is here, but needs to be updated
	   OK -- the structure is ready
     -- final state:
	   NONE -- remove the structure
	   DIRTY -- let it be in the state it is in currently
	   OK -- build it if needed
     -- type:
           FRAGILE -- destroyed by default
	   DURABLE -- preserved by default
     -- list of actions to do if structure is preserved; it may be rerun
        several times (it serves to imply that preserving something causes
	substructures to be preserved).
     -- a piece of code to create the structure; end it with `return true;'
        (or `return false' if it is impossible to create it -- not really
	useful)
     -- a piece of code to update the structure; if ended with `return false;',
        we will try to destroy it and create it from scratch.
     -- a piece of code to destroy the structure; `return false;' if impossible

   The following macros are defined in passes.h:
   
   REQ_STRUCTURE (id, state)

   will attempt to bring the structure ID into requiered STATE.

   FORCE_STRUCTURE (id, state)
   
   will force us to think that the structure ID is in the STATE (without
   actually doing anything).

   STATE_OF_STRUCTURE (id)

   will return state of structure ID (of type enum str_state)

   ASSERT_STRUCTURE (id, state)

   will abort unless state of structure ID is STATE

   You may use them in structure definitions to express prerequisites and
   consequences of an action.

   */

DEF_STRUCTURE (cfg, "cfg", "Control Flow Graph", NONE, NONE, DURABLE,
	       ,
	       rebuild_jump_labels (get_insns ());
	       find_exception_handler_labels ();
	       find_basic_blocks (get_insns (), max_reg_num (), rtl_dump_file);
	       FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, NONE);
	       return true;
	       ,
	       return false;
	       ,
	       free_bb_for_insn ();
	       return true;)

DEF_STRUCTURE (nothing_changed_since_last_cfg_cleanup, "nothing changed since last cfg_cleanup", "tests if nothing changed since last cfg_cleanup", NONE, NONE, FRAGILE,
	       ,
	       return true;
	       ,
	       abort (); /* This structure should never be updated.  */
	       ,
	       return true;)

DEF_STRUCTURE (ssa, "ssa", "SSA form", NONE, NONE, FRAGILE,
	       ,
	       REQ_STRUCTURE (cfg, OK);
	       timevar_push (TV_TO_SSA);
	       open_dump_file (DFI_ssa, current_decl);
	       REQ_STRUCTURE (liveness, OK);

	       RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP, 0));
	       convert_to_ssa ();
	       FORCE_STRUCTURE (liveness, DIRTY);
	       FORCE_STRUCTURE (death_notes, DIRTY);

	       close_dump_file (DFI_ssa, print_rtl_with_bb, get_insns ());
	       timevar_pop (TV_TO_SSA);
	       ggc_collect ();
	       return true;
	       ,
	       abort ();  /* Ssa should never get dirty.  */
	       ,
	       timevar_push (TV_FROM_SSA);
	       open_dump_file (DFI_ussa, current_decl);

	       REQ_STRUCTURE (liveness, OK);
	       convert_from_ssa ();
	       FORCE_STRUCTURE (liveness, DIRTY);
	       FORCE_STRUCTURE (death_notes, DIRTY);
	       /* New registers have been created.  Rescan their usage.  */
	       reg_scan (get_insns (), max_reg_num (), 1);

	       close_dump_file (DFI_ussa, print_rtl_with_bb, get_insns ());
	       timevar_pop (TV_FROM_SSA);
	       return true;)

DEF_STRUCTURE (loops, "loops", "natural loops", NONE, NONE, FRAGILE,
	       ,
	       REQ_STRUCTURE (cfg, OK);
	       flow_loops_find (&loop_tree, LOOP_TREE);
	       return true;
	       ,
	       flow_loops_update (&loop_tree, LOOP_TREE);
	       return true;
	       ,
	       flow_loops_free (&loop_tree);
	       if (loop_tree.num != 0)
		 FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	       loop_tree.num = 0;
	       return true;)

DEF_STRUCTURE (loops_for_loop2, "loops for loop2", "enhanced loops structure for new unroller", NONE, NONE, FRAGILE,
	       PRESERVE_STRUCTURE (loops);
	       ,
	       REQ_STRUCTURE (cfg, OK);
	       if (rtl_dump_file)
	         dump_flow_info (rtl_dump_file);
	       loop_optimizer_init (rtl_dump_file);
	       FORCE_STRUCTURE (nothing_changed_since_loops_for_loop2, OK);
	       return true;
	       ,
	       abort (); /* The loop structure should never get dirty.  */
	       ,
	       if (loop_tree.num > 0)
		 loop_optimizer_finalize (rtl_dump_file);

	       /* We are already done with it, and we need cfgcleanup to
		  know it also.  */
	       FORCE_STRUCTURE (loops_for_loop2, NONE);
	       FORCE_STRUCTURE (nothing_changed_since_last_cfg_cleanup, DIRTY);
	       if (STATE_OF_STRUCTURE (nothing_changed_since_loops_for_loop2) != SS_OK)
		 {
		   RUN_PASS (cfg_cleanup, (CLEANUP_EXPENSIVE, 0));
		   reg_scan (get_insns (), max_reg_num (), 0);
		 }
	       else
		 RUN_PASS (cfg_cleanup, (0, 0));
		
	       if (rtl_dump_file)
		 dump_flow_info (rtl_dump_file);
	       return true;)

DEF_STRUCTURE (nothing_changed_since_loops_for_loop2, "nothing changed since loops for loop2", "tests if nothing changed since loops for loop2", NONE, NONE, FRAGILE,
	       ,
	       return true;
	       ,
	       abort (); /* This structure should never be updated.  */
	       ,
	       return true;)

DEF_STRUCTURE (alias_info, "alias info", "aliasing information", NONE, NONE, FRAGILE,
	       ,
	       init_alias_analysis ();
	       return true;
	       ,
	       return false;
	       ,
	       end_alias_analysis ();
	       return true;)

DEF_STRUCTURE (liveness, "liveness info", "liveness information", NONE, DIRTY, DURABLE,
	       ,
	       REQ_STRUCTURE (cfg, OK);
	       life_analysis (get_insns (), rtl_dump_file, PROP_DEATH_NOTES);
	       FORCE_STRUCTURE (death_notes, OK);
	       return true;
	       ,
	       REQ_STRUCTURE (cfg, OK);
	       /*
	       update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
						 PROP_DEATH_NOTES);
	       */
	       update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
	       FORCE_STRUCTURE (death_notes, OK);
	       return true;
	       ,
	       count_or_remove_death_notes (NULL, 1);
	       return true;)

DEF_STRUCTURE (death_notes, "death notes", "REG_DEAD and REG_UNUSED notes", NONE, DIRTY, DURABLE,
	       ,
	       REQ_STRUCTURE (liveness, OK);
	       if (STATE_OF_STRUCTURE (death_notes) != SS_OK)
		 update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_DEATH_NOTES);
	       return true;
	       ,
	       return false;
	       ,
	       count_or_remove_death_notes (NULL, 1);
	       return true;)

DEF_STRUCTURE (register_usage, "register usage", "statistics of register usage", NONE, NONE, FRAGILE,
	       ,
	       if (reload_completed)
		 return true;
	       REQ_STRUCTURE (cfg, OK);
	       life_analysis (get_insns (), rtl_dump_file, PROP_REG_INFO);
	       return true;
	       ,
	       if (reload_completed)
		 return true;
	       REQ_STRUCTURE (liveness, OK);
	       recompute_reg_usage ();
	       return true;
	       ,
	       return true;)

DEF_STRUCTURE (log_links, "log links", "links from first usage to definition", NONE, NONE, FRAGILE,
	       ,
	       REQ_STRUCTURE (liveness, OK);
	       update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_LOG_LINKS);
	       return true;
	       ,
	       REQ_STRUCTURE (liveness, OK);
	       update_life_info_in_dirty_blocks (UPDATE_LIFE_LOCAL,
						 PROP_LOG_LINKS);
	       return true;
	       ,
	       return true;)

DEF_STRUCTURE (reg_equiv_memory_loc, "register to memory location mapping", "memory locations to which pseudo regs are equivalent", NONE, NONE, DURABLE,
	       ,
	       /* Allocate the reg_equiv_memory_loc array for reload.  */
	       reg_equiv_memory_loc = (rtx *) xcalloc (max_reg_num (), sizeof (rtx));
	       /* And possibly initialize it.  */
	       allocate_initial_values (reg_equiv_memory_loc);
	       return true;
	       ,
	       return false;
	       ,
	       free (reg_equiv_memory_loc);
	       reg_equiv_memory_loc = 0;
	       return true;)


More information about the Gcc-patches mailing list