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]

[PATCH, ira] handle all fixed register classes


This is the rest of the solution for PR43520.  The IA-64 port has some
register classes in which all of the registers are fixed.  The
scheduling reg pressure code in ira sees that we have a class with 0
allocatable registers and decides to add extra dependencies to prevent
increasing register pressure.  But if we have no allocatable registers,
then we can't possibly have a register pressure problem.  So ira should
be ignoring classes with no allocatable registers.

This patch was tested with an ia64-linux C and C++ bootstrap and make
check.  I also verified by hand that is solves the original problem.

I also tested this with an x86-linux bootstrap (all default languages)
and make check.  There were no regressions.  I did this with an extra
line added
  ira_assert (ira_available_class_regs[cl] != 0);
The assert never triggered showing that this patch has no effect on
32-bit x86-linux code.

OK?

Jim

2010-04-19  James E. Wilson  <wilson@codesourcery.com>

	PR rtl-optimization/43520
	* ira-lives.c (ira_implicitly_set_insn_hard_regs): Exclude classes with
	zero available registers.

Index: ira-lives.c
===================================================================
--- ira-lives.c	(revision 158495)
+++ ira-lives.c	(working copy)
@@ -805,6 +805,9 @@ ira_implicitly_set_insn_hard_regs (HARD_
 			? GENERAL_REGS
 			: REG_CLASS_FROM_CONSTRAINT (c, p));
 		  if (cl != NO_REGS
+		      /* There is no register pressure problem if all of the
+			 regs in this class are fixed.  */
+		      && ira_available_class_regs[cl] != 0
 		      && (ira_available_class_regs[cl]
 			  <= ira_reg_class_nregs[cl][mode]))
 		    IOR_HARD_REG_SET (*set, reg_class_contents[cl]);

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