Cleanup for -fdump-unnumbered:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Tue, 6 Oct 1998 09:03:38 +0000 (09:03 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Tue, 6 Oct 1998 09:03:38 +0000 (10:03 +0100)
* 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.

From-SVN: r22865

gcc/ChangeLog
gcc/flags.h
gcc/flow.c
gcc/invoke.texi
gcc/print-rtl.c
gcc/rtl.h
gcc/toplev.c

index e50a261eb31912c0bdde06f50d299f4b7d79fa3d..f316ada804cd8e1cd5327f4d04ed0646d164be80 100644 (file)
@@ -1,3 +1,13 @@
+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.
+
 Tue Oct  6 01:36:00 1998  Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
 
        * Makefile.in (stupid.o): Update dependencies.
index a40375065e38341bbd74266fbd8c3fcd29ba5408..3b7dd5ee3b8dd47c5b90f960cec2eec4f22a8ac3 100644 (file)
@@ -356,6 +356,11 @@ extern int flag_branch_on_count_reg;
 
 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 f963c107c713ddebdc074227f21bf2d94972c632..d6024369e743d5228f64f026c117ab2190738f77 100644 (file)
@@ -3171,7 +3171,6 @@ print_rtl_with_bb (outf, rtx_first)
      FILE *outf;
      rtx rtx_first;
 {
-  extern int flag_dump_unnumbered;
   register rtx tmp_rtx;
 
   if (rtx_first == 0)
@@ -3209,6 +3208,8 @@ print_rtl_with_bb (outf, rtx_first)
 
       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:",
@@ -3231,13 +3232,12 @@ print_rtl_with_bb (outf, rtx_first)
          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);
+         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 (! flag_dump_unnumbered
-             || GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0)
+         if (did_output)
            putc ('\n', outf);
        }
     }
index 1bf0454512246f21ac8f154f1c747b42973f5a8d..d0339e47699c31a9e74d058466cf969d746fc1c2 100644 (file)
@@ -136,7 +136,7 @@ in the following sections.
 @item Debugging Options
 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
 @smallexample
--a  -ax  -d@var{letters}  -fpretend-float
+-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+
@@ -2033,6 +2033,12 @@ Dump debugging information during parsing, to standard error.
 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
 same floating point format as the host machine.  This causes incorrect
index 415a2cc8ad41c5c8b2ffcdab479a3094cf8d2d1c..e3b36fe0a262170a25d4f5699f35a03a5f830c67 100644 (file)
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "bitmap.h"
 #include "real.h"
+#include "flags.h"
 
 
 /* How to print out a register name.
@@ -54,7 +55,11 @@ static int indent;
 
 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
@@ -409,8 +414,9 @@ print_rtl (outf, rtx_first)
 }
 
 /* Like print_rtx, except specify a file.  */
+/* Return nonzero if we actually printed anything.  */
 
-void
+int
 print_rtl_single (outf, x)
      FILE *outf;
      rtx x;
@@ -422,5 +428,7 @@ print_rtl_single (outf, x)
     {
       print_rtx (x);
       putc ('\n', outf);
+      return 1;
     }
+  return 0;
 }
index dc432f34505c0e5d1e725008bcab680d3fd61c29..18751bbabf5a7b30546b373312616e43ad4d1ade 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1344,7 +1344,7 @@ extern void debug_rtx_list                PROTO ((rtx, int));
 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 int print_rtl_single            PROTO ((FILE *, rtx));
 extern void print_inline_rtx           PROTO ((FILE *, rtx, int));
 #endif
 
index 6ca6b93d1c1094d785501418eb8accdea6e9f4ec..7193cecd0222b96cf1cca9070f13cf0dd2c21fb1 100644 (file)
@@ -725,8 +725,6 @@ int flag_argument_noalias = 0;
    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;