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]

Cleanup patch for -fdump-unnumbered applied


Tue Oct  6 17:00:42 1998  J"orn Rennecke <amylaar@cygnus.co.uk>

	* flags.h (flag_dump_unnumbered): Declare.
	* toplev.c (flag_dump_unnumbered): Don't declare.
	* print-rtl.c (flags.h): Include.
	(print_rtl_single): Add return value.
	* rtl.h (print_rtl_single): Update declaration.
	* flow.c (flag_dump_unnumbered): Don't declare.
	(print_rtl_with_bb): Use return value of print_rtl_single.

Index: flags.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/flags.h,v
retrieving revision 1.19
diff -p -r1.19 flags.h
*** flags.h	1998/09/28 06:23:55	1.19
--- flags.h	1998/09/29 22:22:11
*************** extern int flag_branch_on_count_reg;
*** 356,361 ****
--- 356,366 ----
  
  extern int flag_delayed_branch;
  
+ /* Nonzero means suppress output of instruction numbers and line number
+    notes in debugging dumps.  */
+ 
+ extern int flag_dump_unnumbered;
+ 
  /* Nonzero means pretend it is OK to examine bits of target floats,
     even if that isn't true.  The resulting code will have incorrect constants,
     but the same series of instructions that the native compiler would make.  */
Index: flow.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/flow.c,v
retrieving revision 1.61
diff -p -r1.61 flow.c
*** flow.c	1998/09/21 13:59:47	1.61
--- flow.c	1998/09/29 22:22:12
*************** print_rtl_with_bb (outf, rtx_first)
*** 3171,3177 ****
       FILE *outf;
       rtx rtx_first;
  {
-   extern int flag_dump_unnumbered;
    register rtx tmp_rtx;
  
    if (rtx_first == 0)
--- 3171,3176 ----
*************** print_rtl_with_bb (outf, rtx_first)
*** 3209,3214 ****
--- 3208,3215 ----
  
        for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
  	{
+ 	  int did_output;
+ 
  	  if ((bb = start[INSN_UID (tmp_rtx)]) >= 0)
  	    {
  	      fprintf (outf, ";; Start of basic block %d, registers live:",
*************** print_rtl_with_bb (outf, rtx_first)
*** 3231,3243 ****
  	  else if (in_bb_p[ INSN_UID(tmp_rtx)] == IN_MULTIPLE_BB)
  	    fprintf (outf, ";; Insn is in multiple basic blocks\n");
  
! 	  print_rtl_single (outf, tmp_rtx);
  
  	  if ((bb = end[INSN_UID (tmp_rtx)]) >= 0)
  	    fprintf (outf, ";; End of basic block %d\n", bb);
  
! 	  if (! flag_dump_unnumbered
! 	      || GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0)
  	    putc ('\n', outf);
  	}
      }
--- 3232,3243 ----
  	  else if (in_bb_p[ INSN_UID(tmp_rtx)] == IN_MULTIPLE_BB)
  	    fprintf (outf, ";; Insn is in multiple basic blocks\n");
  
! 	  did_output = print_rtl_single (outf, tmp_rtx);
  
  	  if ((bb = end[INSN_UID (tmp_rtx)]) >= 0)
  	    fprintf (outf, ";; End of basic block %d\n", bb);
  
! 	  if (did_output)
  	    putc ('\n', outf);
  	}
      }
Index: invoke.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/invoke.texi,v
retrieving revision 1.71
diff -p -r1.71 invoke.texi
*** invoke.texi	1998/09/29 08:15:16	1.71
--- invoke.texi	1998/09/29 22:22:14
*************** in the following sections.
*** 136,142 ****
  @item Debugging Options
  @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
  @smallexample
! -a  -ax  -d@var{letters}  -fpretend-float
  -fprofile-arcs  -ftest-coverage
  -g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-1  -gdwarf-1+  -gdwarf-2
  -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
--- 136,142 ----
  @item Debugging Options
  @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
  @smallexample
! -a  -ax  -d@var{letters}  -fdump-unnumbered -fpretend-float
  -fprofile-arcs  -ftest-coverage
  -g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-1  -gdwarf-1+  -gdwarf-2
  -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
*************** Dump debugging information during parsin
*** 2032,2037 ****
--- 2032,2043 ----
  @item A
  Annotate the assembler output with miscellaneous debugging information.
  @end table
+ 
+ @item -fdump-unnumbered
+ When doing debugging dumps (see -d option above), suppress instruction
+ numbers and line number note output.  This makes it more feasible to
+ use diff on debugging dumps for compiler invokations with different
+ options, in particular with and without -g.
  
  @item -fpretend-float
  When running a cross-compiler, pretend that the target machine uses the
Index: print-rtl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/print-rtl.c,v
retrieving revision 1.16
diff -p -r1.16 print-rtl.c
*** print-rtl.c	1998/09/09 20:59:53	1.16
--- print-rtl.c	1998/09/29 22:22:14
*************** Boston, MA 02111-1307, USA.  */
*** 24,29 ****
--- 24,30 ----
  #include "rtl.h"
  #include "bitmap.h"
  #include "real.h"
+ #include "flags.h"
  
  
  /* How to print out a register name.
*************** static int indent;
*** 54,60 ****
--- 55,65 ----
  
  extern char **insn_name_ptr;
  
+ /* Nonzero means suppress output of instruction numbers and line number
+    notes in debugging dumps.
+    This must be defined here so that programs like gencodes can be linked.  */
  int flag_dump_unnumbered = 0;
+ 
  /* Print IN_RTX onto OUTFILE.  This is the recursive part of printing.  */
  
  static void
*************** print_rtl (outf, rtx_first)
*** 409,416 ****
  }
  
  /* Like print_rtx, except specify a file.  */
  
! void
  print_rtl_single (outf, x)
       FILE *outf;
       rtx x;
--- 414,422 ----
  }
  
  /* Like print_rtx, except specify a file.  */
+ /* Return nonzero if we actually printed anything.  */
  
! int
  print_rtl_single (outf, x)
       FILE *outf;
       rtx x;
*************** print_rtl_single (outf, x)
*** 422,426 ****
--- 428,434 ----
      {
        print_rtx (x);
        putc ('\n', outf);
+       return 1;
      }
+   return 0;
  }
Index: rtl.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.h,v
retrieving revision 1.53
diff -p -r1.53 rtl.h
*** rtl.h	1998/09/23 23:28:13	1.53
--- rtl.h	1998/09/29 22:22:15
*************** extern void debug_rtx_list		PROTO ((rtx,
*** 1344,1350 ****
  extern rtx debug_rtx_find		PROTO ((rtx, int));
  #ifdef BUFSIZ
  extern void print_rtl			PROTO ((FILE *, rtx));
! extern void print_rtl_single		PROTO ((FILE *, rtx));
  extern void print_inline_rtx		PROTO ((FILE *, rtx, int));
  #endif
  
--- 1344,1350 ----
  extern rtx debug_rtx_find		PROTO ((rtx, int));
  #ifdef BUFSIZ
  extern void print_rtl			PROTO ((FILE *, rtx));
! extern int print_rtl_single		PROTO ((FILE *, rtx));
  extern void print_inline_rtx		PROTO ((FILE *, rtx, int));
  #endif
  
Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.97
diff -p -r1.97 toplev.c
*** toplev.c	1998/09/21 14:11:35	1.97
--- toplev.c	1998/09/29 22:22:16
*************** int flag_argument_noalias = 0;
*** 721,728 ****
     if alias analysis (in general) is enabled.  */
  int flag_strict_aliasing = 0;
  
- extern int flag_dump_unnumbered;
- 
  /* Instrument functions with calls at entry and exit, for profiling.  */
  int flag_instrument_function_entry_exit = 0;
  
--- 721,726 ----


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