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] ignore debug insns in regclass


The presence of (subreg:SF (reg:DF)) in debug insns prevented certain
registers from being regarded as suitable for allocation to float regs
on ppc64 IIRC.  Although this particular subreg was a bug, that I've
just fixed in a separate patch, debug insns shouldn't affect register
allocation decisions, ever.  Fixed in the vta branch with the
following patch.

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

	* regclass.c (scan_one_insn): Skip debug insns.
	(reg_scan, init_subregs_of_mode): Likewise.

Index: gcc/regclass.c
===================================================================
--- gcc/regclass.c.orig	2007-11-23 18:05:54.000000000 -0200
+++ gcc/regclass.c	2008-01-07 16:52:35.000000000 -0200
@@ -1,6 +1,6 @@
 /* Compute register class preferences for pseudo-registers.
    Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996
-   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -1190,7 +1190,7 @@ scan_one_insn (rtx insn, int pass ATTRIB
   int i, j;
   struct costs op_costs[MAX_RECOG_OPERANDS];
 
-  if (!INSN_P (insn))
+  if (!INSN_P (insn) || DEBUG_INSN_P (insn))
     return insn;
 
   pat_code = GET_CODE (PATTERN (insn));
@@ -2307,7 +2307,7 @@ reg_scan (rtx f, unsigned int nregs ATTR
   timevar_push (TV_REG_SCAN);
 
   for (insn = f; insn; insn = NEXT_INSN (insn))
-    if (INSN_P (insn))
+    if (INSN_P (insn) && !DEBUG_INSN_P (insn))
       {
 	reg_scan_mark_refs (PATTERN (insn), insn);
 	if (REG_NOTES (insn))
@@ -2583,7 +2583,7 @@ init_subregs_of_mode (void)
 
   FOR_EACH_BB (bb)
     FOR_BB_INSNS (bb, insn)
-    if (INSN_P (insn))
+    if (INSN_P (insn) && !DEBUG_INSN_P (insn))
       find_subregs_of_mode (PATTERN (insn));
 
   return 0;

-- 
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]