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

login
register
mail settings
Submitter Joern Rennecke
Date May 3, 2013, 11:42 a.m.
Message ID <20130503074216.xfrvi38m80cos0ck-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/241274/
State New
Headers show

Comments

Joern Rennecke - May 3, 2013, 11:42 a.m.
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.

Patch

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;
 	      }
 	  }