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


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

dump file reorg


Couple o things about the rearrangement:

  * It should be harder to forget to update something when adding
    a new pass, since everything's all in one place.

  * Dump files for passes that are not run are not created. 
    Whee.. no more multitude of zero-length files.

  * The X in z.c.X.foo, by which the dumps are numbered, will
    automatically change as new passes are added.  No more 03-and-a-half.
    The number is static, so it doesn't matter what passes are
    enabled or compiled in, so your fingers can get to know what
    number to type when you want to look at .flow2.


r~

	* Makefile.in (STAGESTUFF): Wildcard all debugging dumps at once.
	(mostlyclean): Likewise.

	* toplev.c (rtl_dump, jump_opt_dump, etc): Remove.
	(struct dump_file_info, enum dump_file_index, dump_file): New.
	(open_dump_file): Take a dump_file_index not a suffix, and a decl
	not a string.  Clean out file if we havn't yet done so.  Do nothing
	if the dump isn't enabled.
	(close_dump_file): Do nothing if the dump isn't open.  Dump 
	graph data if requested.
	(dump_rtl, clean_dump_file): Remove.
	(compile_file): Don't clean the dump files.  Only finalize .bp dump
	if flag_test_coverage or flag_branch_probabilities.  Only finalize
	.combine dump if optimizing.  Iterate over dump_file to finalize the
	graph dumps.
	(rest_of_compilation): Update for open_dump_file/close_dump_file.
	Convert all uses of dump_rtl.
	(decode_d_option): Iterate over dump_file to implement 'a' and to
	locate pass-specific dumps.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.409
diff -c -p -d -r1.409 Makefile.in
*** Makefile.in	2000/03/31 22:28:33	1.409
--- Makefile.in	2000/04/01 18:54:38
*************** STAGESTUFF = *$(objext) insn-flags.h ins
*** 707,717 ****
   $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
   protoize$(exeext) unprotoize$(exeext) \
   specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
!  gcov$(exeext) *.bp \
!  *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
!  *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.gcse *.flow2 *.peephole2 \
!  *.ssa *.ussa \
!  *.[si] libcpp.a \
   $(LANG_STAGESTUFF)
  
  # Members of libgcc1.a.
--- 707,713 ----
   $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
   protoize$(exeext) unprotoize$(exeext) \
   specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
!  gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a \
   $(LANG_STAGESTUFF)
  
  # Members of libgcc1.a.
*************** mostlyclean: $(INTL_MOSTLYCLEAN) lang.mo
*** 2381,2393 ****
  	-rm -f s-* tmp-* stamp-* stmp-*
  	-rm -f */stamp-* */tmp-*
  # Delete debugging dump files.
! 	-rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
! 	-rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.addressof
! 	-rm -f *.regmove *.mach *.bp *.gcse *.flow2 *.peephole2 *.ssa *.ussa
! 	-rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl
! 	-rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2
! 	-rm -f */*.sched2 */*.stack */*.regmove */*.gcse */*.flow2
! 	-rm -f */*.peephole2 */*.ssa */*.ussa
  # Delete some files made during installation.
  	-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
  	-rm -f collect collect2 mips-tfile mips-tdump alloca.s
--- 2377,2383 ----
  	-rm -f s-* tmp-* stamp-* stmp-*
  	-rm -f */stamp-* */tmp-*
  # Delete debugging dump files.
! 	-rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
  # Delete some files made during installation.
  	-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
  	-rm -f collect collect2 mips-tfile mips-tdump alloca.s
*************** mostlyclean: $(INTL_MOSTLYCLEAN) lang.mo
*** 2401,2407 ****
  	-rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
  # Delete core dumps.
  	-rm -f core */core
- 	-rm -f *.bp */*.bp
  
  # Delete all files made by compilation
  # that don't exist in the distribution.
--- 2391,2396 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.311
diff -c -p -d -r1.311 toplev.c
*** toplev.c	2000/03/29 13:10:41	1.311
--- toplev.c	2000/04/01 18:54:38
*************** static void pipe_closed PARAMS ((int)) A
*** 162,179 ****
  /* This might or might not be used in ASM_IDENTIFY_LANGUAGE. */
  static void output_lang_identify PARAMS ((FILE *)) ATTRIBUTE_UNUSED;
  #endif
- static void open_dump_file PARAMS ((const char *, const char *));
- static void close_dump_file PARAMS ((void (*) (FILE *, rtx), rtx));
- static void dump_rtl PARAMS ((const char *, tree, void (*) (FILE *, rtx), rtx));
- static void clean_dump_file PARAMS ((const char *));
  static void compile_file PARAMS ((char *));
  static void display_help PARAMS ((void));
  static void mark_file_stack PARAMS ((void *));
  
  static void decode_d_option PARAMS ((const char *));
! static int  decode_f_option PARAMS ((const char *));
! static int  decode_W_option PARAMS ((const char *));
! static int  decode_g_option PARAMS ((const char *));
  static unsigned int independent_decode_option PARAMS ((int, char **,
  						       unsigned int));
  
--- 162,175 ----
  /* This might or might not be used in ASM_IDENTIFY_LANGUAGE. */
  static void output_lang_identify PARAMS ((FILE *)) ATTRIBUTE_UNUSED;
  #endif
  static void compile_file PARAMS ((char *));
  static void display_help PARAMS ((void));
  static void mark_file_stack PARAMS ((void *));
  
  static void decode_d_option PARAMS ((const char *));
! static int decode_f_option PARAMS ((const char *));
! static int decode_W_option PARAMS ((const char *));
! static int decode_g_option PARAMS ((const char *));
  static unsigned int independent_decode_option PARAMS ((int, char **,
  						       unsigned int));
  
*************** const char *dump_base_name;
*** 230,271 ****
  
  extern int target_flags;
  
! /* Flags saying which kinds of debugging dump have been requested.  */
  
! int rtl_dump = 0;
! int rtl_dump_and_exit = 0;
! int jump_opt_dump = 0;
! int addressof_dump = 0;
! int cse_dump = 0;
! int gcse_dump = 0;
! int loop_dump = 0;
! int cse2_dump = 0;
! int branch_prob_dump = 0;
! int flow_dump = 0;
! int combine_dump = 0;
! int regmove_dump = 0;
! int sched_dump = 0;
! int local_reg_dump = 0;
! int global_reg_dump = 0;
! int flow2_dump = 0;
! int peephole2_dump = 0;
! int sched2_dump = 0;
! int jump2_opt_dump = 0;
! #ifdef DELAY_SLOTS
! int dbr_sched_dump = 0;
! #endif
! int reorder_blocks_dump = 0;
! int flag_print_asm_name = 0;
! #ifdef STACK_REGS
! int stack_reg_dump = 0;
! #endif
! #ifdef MACHINE_DEPENDENT_REORG
! int mach_dep_reorg_dump = 0;
! #endif
! int ssa_dump = 0;
! static int flag_print_mem = 0;
! static int version_flag = 0;
! static char * filename = 0;
  enum graph_dump_types graph_dump_format;
  
  /* Name for output file of assembly code, specified with -o.  */
--- 226,324 ----
  
  extern int target_flags;
  
! /* Describes a dump file.  */
  
! struct dump_file_info
! {
!   /* The unique extension to apply, e.g. ".jump".  */
!   const char * const extension;
! 
!   /* The -d<c> character that enables this dump file.  */
!   char const debug_switch;
! 
!   /* True if there is a corresponding graph dump file.  */
!   char const graph_dump_p;
! 
!   /* True if the user selected this dump.  */
!   char enabled;
! 
!   /* True if the files have been initialized (ie truncated).  */
!   char initialized;
! };
! 
! /* Enumerate the extant dump files.  */
! 
! enum dump_file_index
! {
!   DFI_rtl,
!   DFI_jump,
!   DFI_cse,
!   DFI_addressof,
!   DFI_ssa,
!   DFI_ussa,
!   DFI_gcse,
!   DFI_loop,
!   DFI_cse2,
!   DFI_bp,
!   DFI_flow,
!   DFI_combine,
!   DFI_regmove,
!   DFI_sched,
!   DFI_lreg,
!   DFI_greg,
!   DFI_flow2,
!   DFI_peephole2,
!   DFI_sched2,
!   DFI_bbro,
!   DFI_jump2,
!   DFI_mach,
!   DFI_dbr,
!   DFI_stack,
!   DFI_MAX
! };
! 
! /* Describes all the dump files.  Should be kept in order of the
!    pass and in sync with dump_file_index above.  */
! 
! struct dump_file_info dump_file[DFI_MAX] = 
! {
!   { "rtl",	'r', 0, 0, 0 },
!   { "jump",	'j', 0, 0, 0 },
!   { "cse",	's', 0, 0, 0 },
!   { "addressof", 'F', 0, 0, 0 },
!   { "ssa",	'e', 1, 0, 0 },
!   { "ussa",	'e', 1, 0, 0 },	/* Yes, duplicate enable switch.  */
!   { "gcse",	'G', 1, 0, 0 },
!   { "loop",	'L', 1, 0, 0 },
!   { "cse2",	't', 1, 0, 0 },
!   { "bp",	'b', 1, 0, 0 },
!   { "flow",	'f', 1, 0, 0 },
!   { "combine",	'c', 1, 0, 0 },
!   { "regmove",	'N', 1, 0, 0 },
!   { "sched",	'S', 1, 0, 0 },
!   { "lreg",	'l', 1, 0, 0 },
!   { "greg",	'g', 1, 0, 0 },
!   { "flow2",	'w', 1, 0, 0 },
!   { "peephole2", 'z', 1, 0, 0 },
!   { "sched2",	'R', 1, 0, 0 },
!   { "bbro",	'B', 1, 0, 0 },
!   { "jump2",	'J', 1, 0, 0 },
!   { "mach",	'M', 1, 0, 0 },
!   { "dbr",	'd', 0, 0, 0 },
!   { "stack",	'k', 1, 0, 0 },
! };
! 
! static int open_dump_file PARAMS ((enum dump_file_index, tree));
! static void close_dump_file PARAMS ((enum dump_file_index,
! 				     void (*) (FILE *, rtx), rtx));
! 
! /* Other flags saying which kinds of debugging dump have been requested.  */
! 
! int rtl_dump_and_exit;
! int flag_print_asm_name;
! static int flag_print_mem;
! static int version_flag;
! static char * filename;
  enum graph_dump_types graph_dump_format;
  
  /* Name for output file of assembly code, specified with -o.  */
*************** output_lang_identify (asm_out_file)
*** 1736,1781 ****
  }
  #endif
  
! /* Routine to open a dump file.  */
! static void
! open_dump_file (suffix, function_name)
!      const char *suffix;
!      const char *function_name;
  {
!   char *dumpname;
  
    TIMEVAR
      (dump_time,
!      {
!        dumpname = concat (dump_base_name, suffix, NULL);
! 
!        if (rtl_dump_file != NULL)
! 	 fclose (rtl_dump_file);
    
!        rtl_dump_file = fopen (dumpname, "a");
!        
!        if (rtl_dump_file == NULL)
! 	 pfatal_with_name (dumpname);
         
!        free (dumpname);
  
!        if (function_name)
! 	 fprintf (rtl_dump_file, "\n;; Function %s\n\n", function_name);
!      });
    
!   return;
  }
  
  /* Routine to close a dump file.  */
  static void
! close_dump_file (func, insns)
       void (*func) PARAMS ((FILE *, rtx));
       rtx    insns;
  {
    TIMEVAR
      (dump_time,
!      {
!        if (func)
  	 func (rtl_dump_file, insns);
         
         fflush (rtl_dump_file);
--- 1789,1877 ----
  }
  #endif
  
! /* 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;
  {
!   char *dump_name;
!   const char *open_arg;
!   char seq[16];
  
+   if (! dump_file[index].enabled)
+     return 0;
+ 
    TIMEVAR
      (dump_time,
!       {
! 	if (rtl_dump_file != NULL)
! 	  fclose (rtl_dump_file);
    
! 	sprintf (seq, ".%02d.", index);
! 
! 	if (! dump_file[index].initialized)
! 	  {
! 	    /* If we've not initialized the files, do so now.  */
! 	    if (graph_dump_format != no_graph
! 		&& dump_file[index].graph_dump_p)
! 	      {
! 		dump_name = concat (seq, dump_file[index].extension, NULL);
! 		clean_graph_dump_file (dump_base_name, dump_name);
! 		free (dump_name);
! 	      }
! 	    dump_file[index].initialized = 1;
! 	    open_arg = "w";
! 	  }
! 	else
! 	  open_arg = "a";
! 
! 	dump_name = concat (dump_base_name, seq,
! 			    dump_file[index].extension, NULL);
! 
! 	rtl_dump_file = fopen (dump_name, open_arg);
! 	if (rtl_dump_file == NULL)
! 	  pfatal_with_name (dump_name);
         
! 	free (dump_name);
  
! 	if (decl)
! 	  fprintf (rtl_dump_file, "\n;; Function %s\n\n",
! 		   decl_printable_name (decl, 2));
!       });
    
!   return 1;
  }
  
  /* Routine to close a dump file.  */
+ 
  static void
! close_dump_file (index, func, insns)
!      enum dump_file_index index;
       void (*func) PARAMS ((FILE *, rtx));
       rtx    insns;
  {
+   if (! rtl_dump_file)
+     return;
+ 
    TIMEVAR
      (dump_time,
!       {
! 	if (insns
! 	    && graph_dump_format != no_graph
! 	    && dump_file[index].graph_dump_p)
! 	  {
! 	    char seq[16];
! 	    char *suffix;
! 
! 	    sprintf (seq, ".%02d.", index);
! 	    suffix = concat (seq, dump_file[index].extension, NULL);
! 	    print_rtl_graph_with_bb (dump_base_name, suffix, insns);
! 	    free (suffix);
! 	  }
! 
!        if (func && insns)
  	 func (rtl_dump_file, insns);
         
         fflush (rtl_dump_file);
*************** close_dump_file (func, insns)
*** 1783,1822 ****
         
         rtl_dump_file = NULL;
       });
- 
-   return;
- }
- 
- /* Routine to dump rtl into a file.  */
- static void
- dump_rtl (suffix, decl, func, insns)
-      const char *suffix;
-      tree   decl;
-      void (*func) PARAMS ((FILE *, rtx));
-      rtx    insns;
- {
-   open_dump_file (suffix, decl_printable_name (decl, 2));
-   close_dump_file (func, insns);
- }
- 
- /* Routine to empty a dump file.  */
- static void
- clean_dump_file (suffix)
-   const char *suffix;
- {
-   char * const dumpname = concat (dump_base_name, suffix, NULL);
- 
-   rtl_dump_file = fopen (dumpname, "w");
- 
-   if (rtl_dump_file == NULL)
-     pfatal_with_name (dumpname);       
- 
-   free (dumpname);
- 
-   fclose (rtl_dump_file);
-   rtl_dump_file = NULL;
-   
-   return;
  }
  
  /* Do any final processing required for the declarations in VEC, of
--- 1879,1884 ----
*************** compile_file (name)
*** 2148,2300 ****
  	pfatal_with_name (aux_info_file_name);
      }
  
-   /* Clear the dump files.  */
-   if (rtl_dump)
-     clean_dump_file (".00.rtl");
-   if (jump_opt_dump)
-     {
-       clean_dump_file (".01.jump");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".01.jump");
-     }
-   if (cse_dump)
-     {
-       clean_dump_file (".02.cse");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".02.cse");
-     }
-   if (addressof_dump)
-     {
-       clean_dump_file (".03.addressof");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".03.addressof");
-     }
-   if (ssa_dump)
-     {
-       clean_dump_file (".033.ssa");
-       clean_dump_file (".037.ussa");
-     }
-   if (gcse_dump)
-     {
-       clean_dump_file (".04.gcse");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".04.gcse");
-     }
-   if (loop_dump)
-     {
-       clean_dump_file (".05.loop");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".05.loop");
-     }
-   if (cse2_dump)
-     {
-       clean_dump_file (".06.cse2");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".06.cse2");
-     }
-   if (branch_prob_dump)
-     {
-       clean_dump_file (".07.bp");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".07.bp");
-     }
-   if (flow_dump)
-     {
-       clean_dump_file (".08.flow");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".08.flow");
-     }
-   if (combine_dump)
-     {
-       clean_dump_file (".09.combine");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".09.combine");
-     }
-   if (regmove_dump)
-     {
-       clean_dump_file (".10.regmove");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".10.regmove");
-     }
- #ifdef INSN_SCHEDULING
-   if (sched_dump)
-     {
-       clean_dump_file (".11.sched");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".11.sched");
-     }
- #endif
-   if (local_reg_dump)
-     {
-       clean_dump_file (".12.lreg");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".12.lreg");
-     }
-   if (global_reg_dump)
-     {
-       clean_dump_file (".13.greg");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".13.greg");
-     }
-   if (flow2_dump)
-     {
-       clean_dump_file (".14.flow2");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".14.flow2");
-     }
- #ifdef HAVE_peephole2
-   if (peephole2_dump)
-     {
-       clean_dump_file (".15.peephole2");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".15.peephole2");
-     }
- #endif
- #ifdef INSN_SCHEDULING
-   if (sched2_dump)
-     {
-       clean_dump_file (".16.sched2");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".16.sched2");
-     }
- #endif
-   if (reorder_blocks_dump)
-     {
-       clean_dump_file (".bbro");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".bbro");
-     }
-   if (jump2_opt_dump)
-     {
-       clean_dump_file (".17.jump2");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".17.jump2");
-     }
- #ifdef MACHINE_DEPENDENT_REORG
-   if (mach_dep_reorg_dump)
-     {
-       clean_dump_file (".18.mach");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".18.mach");
-     }
- #endif
- #ifdef DELAY_SLOTS
-   if (dbr_sched_dump)
-     {
-       clean_dump_file (".19.dbr");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".19.dbr");
-     }
- #endif
- #ifdef STACK_REGS
-   if (stack_reg_dump)
-     {
-       clean_dump_file (".20.stack");
-       if (graph_dump_format != no_graph)
- 	clean_graph_dump_file (dump_base_name, ".20.stack");
-     }
- #endif
- 
    /* Open assembler code output file.  */
  
    if (flag_syntax_only)
--- 2210,2215 ----
*************** compile_file (name)
*** 2559,2577 ****
  
    end_final (dump_base_name);
     
!   if (branch_prob_dump)
!     open_dump_file (".07.bp", NULL);
     
!   TIMEVAR (dump_time, end_branch_prob (rtl_dump_file));
     
!   if (branch_prob_dump)
!     close_dump_file (NULL, NULL_RTX);
     
  #ifdef ASM_FILE_END
    ASM_FILE_END (asm_out_file);
  #endif
  
- 
    /* Language-specific end of compilation actions.  */
   finish_syntax:
    lang_finish ();
--- 2474,2492 ----
  
    end_final (dump_base_name);
     
!   if (flag_test_coverage || flag_branch_probabilities)
!     {
!       open_dump_file (DFI_bp, NULL);
     
!       TIMEVAR (dump_time, end_branch_prob (rtl_dump_file));
     
!       close_dump_file (DFI_bp, NULL, NULL_RTX);
!     }
     
  #ifdef ASM_FILE_END
    ASM_FILE_END (asm_out_file);
  #endif
  
    /* Language-specific end of compilation actions.  */
   finish_syntax:
    lang_finish ();
*************** compile_file (name)
*** 2585,2595 ****
  	unlink (aux_info_file_name);
      }
  
!   if (combine_dump)
      {
-       open_dump_file (".09.combine", NULL);
        TIMEVAR (dump_time, dump_combine_total_stats (rtl_dump_file));
!       close_dump_file (NULL, NULL_RTX);
      }
  
    /* Close non-debugging input and output files.  Take special care to note
--- 2500,2509 ----
  	unlink (aux_info_file_name);
      }
  
!   if (optimize > 0 && open_dump_file (DFI_combine, NULL))
      {
        TIMEVAR (dump_time, dump_combine_total_stats (rtl_dump_file));
!       close_dump_file (DFI_combine, NULL, NULL_RTX);
      }
  
    /* Close non-debugging input and output files.  Take special care to note
*************** compile_file (name)
*** 2605,2664 ****
    /* Do whatever is necessary to finish printing the graphs.  */
    if (graph_dump_format != no_graph)
      {
!       if (jump_opt_dump)
! 	finish_graph_dump_file (dump_base_name, ".01.jump");
!       if (cse_dump)
! 	finish_graph_dump_file (dump_base_name, ".02.cse");
!       if (addressof_dump)
! 	finish_graph_dump_file (dump_base_name, ".03.addressof");
!       if (gcse_dump)
! 	finish_graph_dump_file (dump_base_name, ".04.gcse");
!       if (loop_dump)
! 	finish_graph_dump_file (dump_base_name, ".05.loop");
!       if (cse2_dump)
! 	finish_graph_dump_file (dump_base_name, ".06.cse2");
!       if (branch_prob_dump)
! 	finish_graph_dump_file (dump_base_name, ".07.bp");
!       if (flow_dump)
! 	finish_graph_dump_file (dump_base_name, ".08.flow");
!       if (combine_dump)
! 	finish_graph_dump_file (dump_base_name, ".09.combine");
!       if (regmove_dump)
! 	finish_graph_dump_file (dump_base_name, ".10.regmove");
! #ifdef INSN_SCHEDULING
!       if (sched_dump)
! 	finish_graph_dump_file (dump_base_name, ".11.sched");
! #endif
!       if (local_reg_dump)
! 	finish_graph_dump_file (dump_base_name, ".12.lreg");
!       if (global_reg_dump)
! 	finish_graph_dump_file (dump_base_name, ".13.greg");
!       if (flow2_dump)
! 	finish_graph_dump_file (dump_base_name, ".14.flow2");
! #ifdef HAVE_peephole2
!       if (flow2_dump)
! 	finish_graph_dump_file (dump_base_name, ".15.peephole2");
! #endif
! #ifdef INSN_SCHEDULING
!       if (sched2_dump)
! 	finish_graph_dump_file (dump_base_name, ".16.sched2");
! #endif
!       if (reorder_blocks_dump)
! 	finish_graph_dump_file (dump_base_name, ".bbro");
!       if (jump2_opt_dump)
! 	finish_graph_dump_file (dump_base_name, ".17.jump2");
! #ifdef MACHINE_DEPENDENT_REORG
!       if (mach_dep_reorg_dump)
! 	finish_graph_dump_file (dump_base_name, ".18.mach");
! #endif
! #ifdef DELAY_SLOTS
!       if (dbr_sched_dump)
! 	finish_graph_dump_file (dump_base_name, ".19.dbr");
! #endif
! #ifdef STACK_REGS
!       if (stack_reg_dump)
! 	finish_graph_dump_file (dump_base_name, ".20.stack");
! #endif
      }
  
    /* Free up memory for the benefit of leak detectors.  */
--- 2519,2537 ----
    /* Do whatever is necessary to finish printing the graphs.  */
    if (graph_dump_format != no_graph)
      {
!       int i;
! 
!       for (i = 0; i < DFI_MAX; ++i)
! 	if (dump_file[i].initialized && dump_file[i].graph_dump_p)
! 	  {
! 	    char seq[16];
! 	    char *suffix;
! 
! 	    sprintf (seq, ".%02d.", i);
! 	    suffix = concat (seq, dump_file[i].extension, NULL);
! 	    finish_graph_dump_file (dump_base_name, suffix);
! 	    free (suffix);
! 	  }
      }
  
    /* Free up memory for the benefit of leak detectors.  */
*************** rest_of_compilation (decl)
*** 2936,2949 ****
  
        /* Dump the rtl code if we are dumping rtl.  */
  
!       if (rtl_dump)
  	{
- 	  open_dump_file (".00.rtl", decl_printable_name (decl, 2));
- 	  
  	  if (DECL_SAVED_INSNS (decl))
  	    fprintf (rtl_dump_file, ";; (integrable)\n\n");
! 	  
! 	  close_dump_file (print_rtl, insns);
  	}
  
        /* If function is inline, and we don't yet know whether to
--- 2809,2819 ----
  
        /* 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);
  	}
  
        /* If function is inline, and we don't yet know whether to
*************** rest_of_compilation (decl)
*** 3069,3076 ****
    /* Find all the EH handlers.  */
    find_exception_handler_labels ();
  
!   if (jump_opt_dump)
!     open_dump_file (".01.jump", decl_printable_name (decl, 2));
  
    /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
       are initialized and to compute whether control can drop off the end
--- 2939,2945 ----
    /* Find all the EH handlers.  */
    find_exception_handler_labels ();
  
!   open_dump_file (DFI_jump, decl);
  
    /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
       are initialized and to compute whether control can drop off the end
*************** rest_of_compilation (decl)
*** 3086,3094 ****
       memory.  */
    renumber_insns (rtl_dump_file);
  
!   /* Dump rtl code after jump, if we are doing that.  */
!   if (jump_opt_dump)
!     close_dump_file (print_rtl, insns);
  
    /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
    if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
--- 2955,2961 ----
       memory.  */
    renumber_insns (rtl_dump_file);
  
!   close_dump_file (DFI_jump, print_rtl, insns);
  
    /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
    if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
*************** rest_of_compilation (decl)
*** 3108,3115 ****
  
    if (optimize > 0)
      {
!       if (cse_dump)
! 	open_dump_file (".02.cse", decl_printable_name (decl, 2));
  
        TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1));
  
--- 2975,2981 ----
  
    if (optimize > 0)
      {
!       open_dump_file (DFI_cse, decl);
  
        TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1));
  
*************** rest_of_compilation (decl)
*** 3139,3181 ****
           removed a bunch more instructions.  */
        renumber_insns (rtl_dump_file);
  
!       /* Dump rtl code after cse, if we are doing that.  */
!       if (cse_dump)
! 	{
! 	  close_dump_file (print_rtl, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".02.cse", insns);
! 	}
      }
  
    purge_addressof (insns);
    reg_scan (insns, max_reg_num (), 1);
  
!   if (addressof_dump)
!     {
!       dump_rtl (".03.addressof", decl, print_rtl, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".03.addressof", insns);
!     }
  
    if (ggc_p)
      ggc_collect ();
  
    if (flag_ssa)
      {
!       if (ssa_dump)
! 	open_dump_file (".033.ssa", decl_printable_name (decl, 2));
        convert_to_ssa ();
!       if (ssa_dump)
! 	close_dump_file (print_rtl_with_bb, insns);
  
!       if (ssa_dump)
! 	open_dump_file (".037.ussa", decl_printable_name (decl, 2));
        convert_from_ssa ();
        /* New registers have been created.  Rescan their usage.  */
        reg_scan (insns, max_reg_num (), 1);
!       if (ssa_dump)
! 	close_dump_file (print_rtl_with_bb, insns);
  
        /* Life analysis used in SSA adds log_links but these shouldn't
  	 be there until the flow stage, so clear them away.  */
--- 3005,3034 ----
           removed a bunch more instructions.  */
        renumber_insns (rtl_dump_file);
  
!       close_dump_file (DFI_cse, print_rtl, insns);
      }
  
+   open_dump_file (DFI_addressof, decl);
+ 
    purge_addressof (insns);
    reg_scan (insns, max_reg_num (), 1);
  
!   close_dump_file (DFI_addressof, print_rtl, insns);
  
    if (ggc_p)
      ggc_collect ();
  
    if (flag_ssa)
      {
!       open_dump_file (DFI_ssa, decl);
        convert_to_ssa ();
!       close_dump_file (DFI_ssa, print_rtl_with_bb, insns);
  
!       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);
  
        /* Life analysis used in SSA adds log_links but these shouldn't
  	 be there until the flow stage, so clear them away.  */
*************** rest_of_compilation (decl)
*** 3189,3196 ****
  
    if (optimize > 0 && flag_gcse)
      {
!       if (gcse_dump)
! 	open_dump_file (".04.gcse", decl_printable_name (decl, 2));
  
        TIMEVAR (gcse_time, tem = gcse_main (insns, rtl_dump_file));
  
--- 3042,3048 ----
  
    if (optimize > 0 && flag_gcse)
      {
!       open_dump_file (DFI_gcse, decl);
  
        TIMEVAR (gcse_time, tem = gcse_main (insns, rtl_dump_file));
  
*************** rest_of_compilation (decl)
*** 3203,3214 ****
  					     !JUMP_AFTER_REGSCAN));
          }
  
!       if (gcse_dump)
! 	{
! 	  close_dump_file (print_rtl, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".04.gcse", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3055,3061 ----
  					     !JUMP_AFTER_REGSCAN));
          }
  
!       close_dump_file (DFI_gcse, print_rtl, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3217,3225 ****
  
    if (optimize > 0)
      {
!       if (loop_dump)
! 	open_dump_file (".05.loop", decl_printable_name (decl, 2));
! 	
        TIMEVAR
  	(loop_time,
  	 {
--- 3064,3071 ----
  
    if (optimize > 0)
      {
!       open_dump_file (DFI_loop, decl);
! 
        TIMEVAR
  	(loop_time,
  	 {
*************** rest_of_compilation (decl)
*** 3243,3256 ****
  	   loop_optimize (insns, rtl_dump_file, flag_unroll_loops, 1);
  	 });
  
!       /* Dump rtl code after loop opt, if we are doing that.  */
! 
!       if (loop_dump)
! 	{
! 	  close_dump_file (print_rtl, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".05.loop", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3089,3095 ----
  	   loop_optimize (insns, rtl_dump_file, flag_unroll_loops, 1);
  	 });
  
!       close_dump_file (DFI_loop, print_rtl, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3263,3270 ****
  
    if (optimize > 0)
      {
!       if (cse2_dump)
! 	open_dump_file (".06.cse2", decl_printable_name (decl, 2));
  
        if (flag_rerun_cse_after_loop)
  	{
--- 3102,3108 ----
  
    if (optimize > 0)
      {
!       open_dump_file (DFI_cse2, decl);
  
        if (flag_rerun_cse_after_loop)
  	{
*************** rest_of_compilation (decl)
*** 3295,3307 ****
  	  TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
  	}
  
!       /* Dump rtl code after cse, if we are doing that.  */
!       if (cse2_dump)
! 	{
! 	  close_dump_file (print_rtl, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".06.cse2", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3133,3139 ----
  	  TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
  	}
  
!       close_dump_file (DFI_cse2, print_rtl, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3309,3316 ****
  
    if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
      {
!       if (branch_prob_dump)
! 	open_dump_file (".07.bp", decl_printable_name (decl, 2));
  
        TIMEVAR
  	(branch_prob_time,
--- 3141,3147 ----
  
    if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
      {
!       open_dump_file (DFI_bp, decl);
  
        TIMEVAR
  	(branch_prob_time,
*************** rest_of_compilation (decl)
*** 3318,3329 ****
  	   branch_prob (insns, rtl_dump_file);
  	 });
  
!       if (branch_prob_dump)
! 	{
! 	  close_dump_file (print_rtl, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".07.bp", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3149,3155 ----
  	   branch_prob (insns, rtl_dump_file);
  	 });
  
!       close_dump_file (DFI_bp, print_rtl, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3334,3341 ****
    /* Print function header into flow dump now
       because doing the flow analysis makes some of the dump.  */
  
!   if (flow_dump)
!     open_dump_file (".08.flow", decl_printable_name (decl, 2));
    
    /* Do control and data flow analysis; wrote some of the results to
       the dump file.  */
--- 3160,3166 ----
    /* Print function header into flow dump now
       because doing the flow analysis makes some of the dump.  */
  
!   open_dump_file (DFI_flow, decl);
    
    /* Do control and data flow analysis; wrote some of the results to
       the dump file.  */
*************** rest_of_compilation (decl)
*** 3357,3371 ****
        if (extra_warnings)
  	setjmp_args_warning ();
      }
- 
-   /* Dump rtl after flow analysis.  */
  
!   if (flow_dump)
!     {
!       close_dump_file (print_rtl_with_bb, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".08.flow", insns);
!     }
  
    if (ggc_p)
      ggc_collect ();
--- 3182,3189 ----
        if (extra_warnings)
  	setjmp_args_warning ();
      }
  
!   close_dump_file (DFI_flow, print_rtl_with_bb, insns);
  
    if (ggc_p)
      ggc_collect ();
*************** rest_of_compilation (decl)
*** 3380,3385 ****
--- 3198,3205 ----
      {
        int rebuild_jump_labels_after_combine = 0;
  
+       open_dump_file (DFI_combine, decl);
+ 
        TIMEVAR (combine_time, 
  	       {
  		 rebuild_jump_labels_after_combine
*************** rest_of_compilation (decl)
*** 3394,3407 ****
  	  TIMEVAR (jump_time, rebuild_jump_labels (insns));
  	}
  
!       /* Dump rtl code after insn combination.  */
! 
!       if (combine_dump)
! 	{
! 	  dump_rtl (".09.combine", decl, print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".09.combine", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3214,3220 ----
  	  TIMEVAR (jump_time, rebuild_jump_labels (insns));
  	}
  
!       close_dump_file (DFI_combine, print_rtl_with_bb, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3411,3428 ****
       necessary for two-address machines.  */
    if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
      {
!       if (regmove_dump)
! 	open_dump_file (".10.regmove", decl_printable_name (decl, 2));
  
        TIMEVAR (regmove_time, regmove_optimize (insns, max_reg_num (),
  					       rtl_dump_file));
  
!       if (regmove_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".10.regmove", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3224,3235 ----
       necessary for two-address machines.  */
    if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
      {
!       open_dump_file (DFI_regmove, decl);
  
        TIMEVAR (regmove_time, regmove_optimize (insns, max_reg_num (),
  					       rtl_dump_file));
  
!       close_dump_file (DFI_regmove, print_rtl_with_bb, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3439,3460 ****
       because doing the sched analysis makes some of the dump.  */
    if (optimize > 0 && flag_schedule_insns)
      {
!       if (sched_dump)
! 	open_dump_file (".11.sched", decl_printable_name (decl, 2));
  
        /* Do control and data sched analysis,
  	 and write some of the results to dump file.  */
  
        TIMEVAR (sched_time, schedule_insns (rtl_dump_file));
- 
-       /* Dump rtl after instruction scheduling.  */
  
!       if (sched_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".11.sched", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3246,3259 ----
       because doing the sched analysis makes some of the dump.  */
    if (optimize > 0 && flag_schedule_insns)
      {
!       open_dump_file (DFI_sched, decl);
  
        /* Do control and data sched analysis,
  	 and write some of the results to dump file.  */
  
        TIMEVAR (sched_time, schedule_insns (rtl_dump_file));
  
!       close_dump_file (DFI_sched, print_rtl_with_bb, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3466,3473 ****
       epilogue thus changing register elimination offsets.  */
    current_function_is_leaf = leaf_function_p ();
  
!   if (local_reg_dump)
!     open_dump_file (".12.lreg", decl_printable_name (decl, 2));
  
    /* Allocate pseudo-regs that are used only within 1 basic block. 
  
--- 3265,3271 ----
       epilogue thus changing register elimination offsets.  */
    current_function_is_leaf = leaf_function_p ();
  
!   open_dump_file (DFI_lreg, decl);
  
    /* Allocate pseudo-regs that are used only within 1 basic block. 
  
*************** rest_of_compilation (decl)
*** 3484,3506 ****
  	     rebuild_label_notes_after_reload = local_alloc ();
  	   });
  
!   /* Dump rtl code after allocating regs within basic blocks.  */
! 
!   if (local_reg_dump)
      {
        TIMEVAR (dump_time, dump_flow_info (rtl_dump_file));
        TIMEVAR (dump_time, dump_local_alloc (rtl_dump_file));
  
!       close_dump_file (print_rtl_with_bb, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".12.lreg", insns);
      }
  
    if (ggc_p)
      ggc_collect ();
  
!   if (global_reg_dump)
!     open_dump_file (".13.greg", decl_printable_name (decl, 2));
  
    /* If optimizing, allocate remaining pseudo-regs.  Do the reload
       pass fixing up any insns that are invalid.  */
--- 3282,3299 ----
  	     rebuild_label_notes_after_reload = local_alloc ();
  	   });
  
!   if (dump_file[DFI_lreg].enabled)
      {
        TIMEVAR (dump_time, dump_flow_info (rtl_dump_file));
        TIMEVAR (dump_time, dump_local_alloc (rtl_dump_file));
  
!       close_dump_file (DFI_lreg, print_rtl_with_bb, insns);
      }
  
    if (ggc_p)
      ggc_collect ();
  
!   open_dump_file (DFI_greg, decl);
  
    /* If optimizing, allocate remaining pseudo-regs.  Do the reload
       pass fixing up any insns that are invalid.  */
*************** rest_of_compilation (decl)
*** 3541,3557 ****
    if (rebuild_label_notes_after_reload)
      TIMEVAR (jump_time, rebuild_jump_labels (insns));
  
!   if (global_reg_dump)
      {
        TIMEVAR (dump_time, dump_global_regs (rtl_dump_file));
!       close_dump_file (print_rtl_with_bb, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".13.greg", insns);
      }
  
    /* Re-create the death notes which were deleted during reload.  */
!   if (flow2_dump)
!     open_dump_file (".14.flow2", decl_printable_name (decl, 2));
    
    TIMEVAR (flow2_time,
  	   {
--- 3334,3347 ----
    if (rebuild_label_notes_after_reload)
      TIMEVAR (jump_time, rebuild_jump_labels (insns));
  
!   if (dump_file[DFI_greg].enabled)
      {
        TIMEVAR (dump_time, dump_global_regs (rtl_dump_file));
!       close_dump_file (DFI_greg, print_rtl_with_bb, insns);
      }
  
    /* Re-create the death notes which were deleted during reload.  */
!   open_dump_file (DFI_flow2, decl);
    
    TIMEVAR (flow2_time,
  	   {
*************** rest_of_compilation (decl)
*** 3587,3635 ****
  
    flow2_completed = 1;
  
!   if (flow2_dump)
!     {
!       close_dump_file (print_rtl_with_bb, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".14.flow2", insns);
!     }
  
  #ifdef HAVE_peephole2
    if (optimize > 0 && flag_peephole2)
      {
!       if (peephole2_dump)
! 	open_dump_file (".15.peephole2", decl_printable_name (decl, 2));
  
        TIMEVAR (peephole2_time, peephole2_optimize (rtl_dump_file));
  
!       if (peephole2_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".15.peephole2", insns);
! 	}
      }
  #endif
  
  #ifdef INSN_SCHEDULING
    if (optimize > 0 && flag_schedule_insns_after_reload)
      {
!       if (sched2_dump)
! 	open_dump_file (".16.sched2", decl_printable_name (decl, 2));
  
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
        TIMEVAR (sched2_time, schedule_insns (rtl_dump_file));
  
!       /* Dump rtl after post-reorder instruction scheduling.  */
! 
!       if (sched2_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".16.sched2", insns);
! 	}
  
        if (ggc_p)
  	ggc_collect ();
--- 3377,3406 ----
  
    flow2_completed = 1;
  
!   close_dump_file (DFI_flow2, print_rtl_with_bb, insns);
  
  #ifdef HAVE_peephole2
    if (optimize > 0 && flag_peephole2)
      {
!       open_dump_file (DFI_peephole2, decl);
  
        TIMEVAR (peephole2_time, peephole2_optimize (rtl_dump_file));
  
!       close_dump_file (DFI_peephole2, print_rtl_with_bb, insns);
      }
  #endif
  
  #ifdef INSN_SCHEDULING
    if (optimize > 0 && flag_schedule_insns_after_reload)
      {
!       open_dump_file (DFI_sched2, decl);
  
        /* Do control and data sched analysis again,
  	 and write some more of the results to dump file.  */
  
        TIMEVAR (sched2_time, schedule_insns (rtl_dump_file));
  
!       close_dump_file (DFI_sched2, print_rtl_with_bb, insns);
  
        if (ggc_p)
  	ggc_collect ();
*************** rest_of_compilation (decl)
*** 3643,3659 ****
  
    if (optimize > 0 && flag_reorder_blocks)
      {
!       if (reorder_blocks_dump)
! 	open_dump_file (".bbro", decl_printable_name (decl, 2));
  
        TIMEVAR (reorder_blocks_time, reorder_basic_blocks ());
  
!       if (reorder_blocks_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".bbro", insns);
! 	}
      }    
  
    /* One more attempt to remove jumps to .+1 left by dead-store elimination. 
--- 3414,3424 ----
  
    if (optimize > 0 && flag_reorder_blocks)
      {
!       open_dump_file (DFI_bbro, decl);
  
        TIMEVAR (reorder_blocks_time, reorder_basic_blocks ());
  
!       close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
      }    
  
    /* One more attempt to remove jumps to .+1 left by dead-store elimination. 
*************** rest_of_compilation (decl)
*** 3661,3696 ****
  
    if (optimize > 0)
      {
        TIMEVAR (jump_time, jump_optimize (insns, JUMP_CROSS_JUMP,
  					 JUMP_NOOP_MOVES,
  					 !JUMP_AFTER_REGSCAN));
  
!       /* Dump rtl code after jump, if we are doing that.  */
! 
!       if (jump2_opt_dump)
! 	{
! 	  dump_rtl (".17.jump2", decl, print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".17.jump2", insns);
! 	}
      }
  
    /* If a machine dependent reorganization is needed, call it.  */
  #ifdef MACHINE_DEPENDENT_REORG
!   if (mach_dep_reorg_dump)
!     open_dump_file (".18.mach", decl_printable_name (decl, 2));
  
!    MACHINE_DEPENDENT_REORG (insns);
  
!    if (mach_dep_reorg_dump)
!      {
!        close_dump_file (print_rtl_with_bb, insns);
!        if (graph_dump_format != no_graph)
! 	 print_rtl_graph_with_bb (dump_base_name, ".18.mach", insns);
!      }
  
!    if (ggc_p)
!      ggc_collect ();
  #endif
  
    /* If a scheduling pass for delayed branches is to be done,
--- 3426,3450 ----
  
    if (optimize > 0)
      {
+       open_dump_file (DFI_jump2, decl);
+ 
        TIMEVAR (jump_time, jump_optimize (insns, JUMP_CROSS_JUMP,
  					 JUMP_NOOP_MOVES,
  					 !JUMP_AFTER_REGSCAN));
  
!       close_dump_file (DFI_jump2, print_rtl_with_bb, insns);
      }
  
    /* If a machine dependent reorganization is needed, call it.  */
  #ifdef MACHINE_DEPENDENT_REORG
!   open_dump_file (DFI_mach, decl);
  
!   MACHINE_DEPENDENT_REORG (insns);
  
!   close_dump_file (DFI_mach, print_rtl_with_bb, insns);
  
!   if (ggc_p)
!     ggc_collect ();
  #endif
  
    /* If a scheduling pass for delayed branches is to be done,
*************** rest_of_compilation (decl)
*** 3699,3706 ****
  #ifdef DELAY_SLOTS
    if (optimize > 0 && flag_delayed_branch)
      {
!       if (dbr_sched_dump)
! 	open_dump_file (".19.dbr", decl_printable_name (decl, 2));
  
        TIMEVAR
  	(dbr_sched_time,
--- 3453,3459 ----
  #ifdef DELAY_SLOTS
    if (optimize > 0 && flag_delayed_branch)
      {
!       open_dump_file (DFI_dbr, decl);
  
        TIMEVAR
  	(dbr_sched_time,
*************** rest_of_compilation (decl)
*** 3708,3723 ****
             dbr_schedule (insns, rtl_dump_file);
  	 });
  
!       if (dbr_sched_dump)
! 	{
! 	  close_dump_file (print_rtl_with_bb, insns);
! 	  if (graph_dump_format != no_graph)
! 	    print_rtl_graph_with_bb (dump_base_name, ".19.dbr", insns);
! 	}
!     }
  
!    if (ggc_p)
!      ggc_collect ();
  #endif
  
    /* Shorten branches. 
--- 3461,3471 ----
             dbr_schedule (insns, rtl_dump_file);
  	 });
  
!       close_dump_file (DFI_dbr, print_rtl_with_bb, insns);
  
!       if (ggc_p)
! 	ggc_collect ();
!     }
  #endif
  
    /* Shorten branches. 
*************** rest_of_compilation (decl)
*** 3730,3746 ****
  	   });
  
  #ifdef STACK_REGS
!   if (stack_reg_dump)
!     open_dump_file (".20.stack", decl_printable_name (decl, 2));
  
    TIMEVAR (stack_reg_time, reg_to_stack (insns, rtl_dump_file));
  
!   if (stack_reg_dump)
!     {
!       close_dump_file (print_rtl_with_bb, insns);
!       if (graph_dump_format != no_graph)
! 	print_rtl_graph_with_bb (dump_base_name, ".20.stack", insns);
!     }
  
    if (ggc_p)
      ggc_collect ();
--- 3478,3488 ----
  	   });
  
  #ifdef STACK_REGS
!   open_dump_file (DFI_stack, decl);
  
    TIMEVAR (stack_reg_time, reg_to_stack (insns, rtl_dump_file));
  
!   close_dump_file (DFI_stack, print_rtl_with_bb, insns);
  
    if (ggc_p)
      ggc_collect ();
*************** static void
*** 4057,4194 ****
  decode_d_option (arg)
       const char * arg;
  {
!   while (* arg)
!     switch (* arg ++)
        {
        case 'a':
! 	branch_prob_dump = 1;
! 	combine_dump = 1;
! #ifdef DELAY_SLOTS
! 	dbr_sched_dump = 1;
! #endif
! 	reorder_blocks_dump = 1;
! 	flow_dump = 1;
! 	flow2_dump = 1;
! 	global_reg_dump = 1;
! 	jump_opt_dump = 1;
! 	addressof_dump = 1;
! 	jump2_opt_dump = 1;
! 	local_reg_dump = 1;
! 	loop_dump = 1;
! 	regmove_dump = 1;
! 	rtl_dump = 1;
! 	cse_dump = 1;
! 	cse2_dump = 1;
! 	gcse_dump = 1;
! 	sched_dump = 1;
! 	sched2_dump = 1;
! #ifdef STACK_REGS
! 	stack_reg_dump = 1;
! #endif
! #ifdef MACHINE_DEPENDENT_REORG
! 	mach_dep_reorg_dump = 1;
! #endif
! 	peephole2_dump = 1;
! 	ssa_dump = 1;
  	break;
        case 'A':
  	flag_debug_asm = 1;
  	break;
-       case 'b':
- 	branch_prob_dump = 1;
- 	break;
-       case 'B':
- 	reorder_blocks_dump = 1;
- 	break;
-       case 'c':
- 	combine_dump = 1;
- 	break;
- #ifdef DELAY_SLOTS
-       case 'd':
- 	dbr_sched_dump = 1;
- 	break;
- #endif
-       case 'e':
- 	ssa_dump = 1;
- 	break;
-       case 'f':
- 	flow_dump = 1;
- 	break;
-       case 'F':
- 	addressof_dump = 1;
- 	break;
-       case 'g':
- 	global_reg_dump = 1;
- 	break;
-       case 'G':
- 	gcse_dump = 1;
- 	break;
-       case 'j':
- 	jump_opt_dump = 1;
- 	break;
-       case 'J':
- 	jump2_opt_dump = 1;
- 	break;
- #ifdef STACK_REGS		    
-       case 'k':
- 	stack_reg_dump = 1;
- 	break;
- #endif
-       case 'l':
- 	local_reg_dump = 1;
- 	break;
-       case 'L':
- 	loop_dump = 1;
- 	break;
        case 'm':
  	flag_print_mem = 1;
  	break;
- #ifdef MACHINE_DEPENDENT_REORG
-       case 'M':
- 	mach_dep_reorg_dump = 1;
- 	break;
- #endif
        case 'p':
  	flag_print_asm_name = 1;
  	break;
-       case 'r':
- 	rtl_dump = 1;
- 	break;
-       case 'R':
- 	sched2_dump = 1;
- 	break;
-       case 's':
- 	cse_dump = 1;
- 	break;
-       case 'S':
- 	sched_dump = 1;
- 	break;
-       case 't':
- 	cse2_dump = 1;
- 	break;
-       case 'N':
- 	regmove_dump = 1;
- 	break;
        case 'v':
  	graph_dump_format = vcg;
  	break;
-       case 'w':
- 	flow2_dump = 1;
- 	break;
        case 'x':
  	rtl_dump_and_exit = 1;
  	break;
        case 'y':
  	set_yydebug (1);
  	break;
-       case 'z':
- 	peephole2_dump = 1;
- 	break;
        case 'D':	/* These are handled by the preprocessor.  */
        case 'I':
  	break;
        default:
! 	warning ("unrecognized gcc debugging option: %c", arg[-1]);
  	break;
        }
  }
--- 3799,3846 ----
  decode_d_option (arg)
       const char * arg;
  {
!   int i, c, matched;
! 
!   while (*arg)
!     switch (c = *arg++)
        {
        case 'a':
! 	for (i = 0; i < DFI_MAX; ++i)
! 	  dump_file[i].enabled = 1;
  	break;
        case 'A':
  	flag_debug_asm = 1;
  	break;
        case 'm':
  	flag_print_mem = 1;
  	break;
        case 'p':
  	flag_print_asm_name = 1;
  	break;
        case 'v':
  	graph_dump_format = vcg;
  	break;
        case 'x':
  	rtl_dump_and_exit = 1;
  	break;
        case 'y':
  	set_yydebug (1);
  	break;
        case 'D':	/* These are handled by the preprocessor.  */
        case 'I':
  	break;
+ 
        default:
! 	matched = 0;
! 	for (i = 0; i < DFI_MAX; ++i)
! 	  if (c == dump_file[i].debug_switch)
! 	    {
! 	      dump_file[i].enabled = 1;
! 	      matched = 1;
! 	    }
! 
! 	if (! matched)
! 	  warning ("unrecognized gcc debugging option: %c", c);
  	break;
        }
  }

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