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] don't terminate regrename chains at debug insns


Debug insns don't have operands to match, so regrename assumes it
can't change anything in the location expression, and terminates
chains there.  This prevents some regrename opportunities, and messes
the tick counts which results in further codegen changes.  Fixed
as follows.  Will install in vta shortly.

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

	* regrename.c (build_def_use): Don't mark uses in debug insns
	as chain terminators.

Index: gcc/regrename.c
===================================================================
--- gcc/regrename.c.orig	2007-11-03 04:43:23.000000000 -0200
+++ gcc/regrename.c	2007-11-05 02:48:15.000000000 -0200
@@ -258,6 +258,7 @@ regrename_optimize (void)
 	  n_uses = 0;
 	  for (last = this; last->next_use; last = last->next_use)
 	    {
+	      /* ??? Do we need to discount debug insns here?  */
 	      n_uses++;
 	      IOR_COMPL_HARD_REG_SET (this_unavailable,
 				      reg_class_contents[last->cl]);
@@ -809,7 +810,8 @@ build_def_use (basic_block bb)
 	      *recog_data.dup_loc[i] = cc0_rtx;
 	    }
 
-	  scan_rtx (insn, &PATTERN (insn), NO_REGS, terminate_all_read,
+	  scan_rtx (insn, &PATTERN (insn), NO_REGS,
+		    DEBUG_INSN_P (insn) ? mark_access : terminate_all_read,
 		    OP_IN, 0);
 
 	  for (i = 0; i < recog_data.n_dups; i++)
-- 
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]