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]

RFA: fix find_valid_class to accept classes w/out last hard reg


In revision 91802, the tests in find_valid_class got garbled so that with
n > 0, it won't accept a class that does not include FIRST_PSEUDO_REGISTER - 1.

The attached patch restores the status quo ante of allowing register classes
that stop earlier.

This fixes the compile/pr55921.c failures for avr.

bootstrapped/regtested on i686-pc-linux-gnu.
regtested on i686-pc-linuc-gnu X sh-elf.
2013-05-02  Joern Rennecke <joern.rennecke@embecosm.com>

	* reload.c (find_valid_class): Allow classes that do not include
	FIRST_PSEUDO_REGISTER - 1.

Index: reload.c
===================================================================
--- reload.c	(revision 198511)
+++ reload.c	(working copy)
@@ -680,8 +680,8 @@ find_valid_class (enum machine_mode oute
 	    if (HARD_REGNO_MODE_OK (regno, inner))
 	      {
 		good = 1;
-		if (! TEST_HARD_REG_BIT (reg_class_contents[rclass], regno + n)
-		    || ! HARD_REGNO_MODE_OK (regno + n, outer))
+		if (TEST_HARD_REG_BIT (reg_class_contents[rclass], regno + n)
+		    && ! HARD_REGNO_MODE_OK (regno + n, outer))
 		  bad = 1;
 	      }
 	  }

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