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


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

[vta,trunk?] introduce -fdump-unnumbered-links


Even after -fmin-insn-uid (motivated by the wish to not use
-fdump-unnumbered, that dropped too much useful information),
identical insns were still marked as differences if they were preceded
or followed by debug insns, because the doubly-linked list links were
different.  This information is mostly redundant anyway, dropping it
is not a problem for the kind of debugging I was doing.  I didn't make
it imply -fdump-no-addr, like -fdump-unnumbered does, but I don't have
strong reasons for this, and it could easily be changed.

I'm installing this in the vta branch.  Is this useful for mainline
ATM?

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* common.opt (fdump-unnumbered-links): New.
	* doc/invoke.texi (-fdump-unnumbered-links): Document it.
	* print-rtl.c (flag_dump_unnumbered_links): New.
	(print_rtx): Test it.
	
Index: gcc/common.opt
===================================================================
--- gcc/common.opt.orig	2007-12-28 16:19:29.000000000 -0200
+++ gcc/common.opt	2007-12-29 02:31:41.000000000 -0200
@@ -439,6 +439,10 @@ fdump-unnumbered
 Common Report Var(flag_dump_unnumbered) VarExists
 Suppress output of instruction numbers, line number notes and addresses in debugging dumps
 
+fdump-unnumbered-links
+Common Report Var(flag_dump_unnumbered_links) VarExists
+Suppress output of previous and next insn numbers in debugging dumps
+
 fearly-inlining
 Common Report Var(flag_early_inlining) Init(1) Optimization
 Perform early inlining
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi.orig	2007-12-28 16:19:29.000000000 -0200
+++ gcc/doc/invoke.texi	2007-12-29 02:33:34.000000000 -0200
@@ -272,7 +272,8 @@ Objective-C and Objective-C++ Dialects}.
 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
--fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
+-fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
+-fdump-translation-unit@r{[}-@var{n}@r{]} @gol
 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
 -fdump-ipa-all -fdump-ipa-cgraph @gol
 -fdump-tree-all @gol
@@ -4621,6 +4622,12 @@ numbers and address output.  This makes 
 use diff on debugging dumps for compiler invocations with different
 options, in particular with and without @option{-g}.
 
+@item -fdump-unnumbered-links
+@opindex fdump-unnumbered-links
+When doing debugging dumps (see @option{-d} option above), suppress
+instruction numbers for the links to the previous and next instructions
+in a sequence.
+
 @item -fdump-translation-unit @r{(C++ only)}
 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
 @opindex fdump-translation-unit
Index: gcc/print-rtl.c
===================================================================
--- gcc/print-rtl.c.orig	2007-12-28 16:20:15.000000000 -0200
+++ gcc/print-rtl.c	2007-12-29 03:12:53.000000000 -0200
@@ -60,6 +60,11 @@ const char *print_rtx_head = "";
    This must be defined here so that programs like gencodes can be linked.  */
 int flag_dump_unnumbered = 0;
 
+/* Nonzero means suppress output of instruction numbers for previous
+   and next insns in debugging dumps.
+   This must be defined here so that programs like gencodes can be linked.  */
+int flag_dump_unnumbered_links = 0;
+
 /* Nonzero means use simplified format without flags, modes, etc.  */
 int flag_simple = 0;
 
@@ -505,7 +510,10 @@ print_rtx (const_rtx in_rtx)
 		  goto do_e;
 	      }
 
-	    if (flag_dump_unnumbered)
+	    if (flag_dump_unnumbered
+		|| (flag_dump_unnumbered_links && (i == 1 || i == 2)
+		    && (INSN_P (in_rtx) || NOTE_P (in_rtx)
+			|| LABEL_P (in_rtx) || BARRIER_P (in_rtx))))
 	      fputs (" #", outfile);
 	    else
 	      fprintf (outfile, " %d", INSN_UID (sub));

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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