[backport proposed but not yet approved or applied patch for an old reload regression ] List-Archive: Date: Fri, 03 May 2013 07:42:16 -0400 From: Joern Rennecke Subject: 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. gcc/ 2013-05-02 Joern Rennecke * reload.c (find_valid_class): Allow classes that do not include FIRST_PSEUDO_REGISTER - 1. --- gcc-4.8.0/gcc/reload.c.~1~ 2013-02-04 17:23:38.000000000 +0100 +++ gcc-4.8.0/gcc/reload.c 2013-05-04 12:31:42.715330882 +0200 @@ -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; } }