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]

Re: Improved search for reload_address_base_reg_class



  In message <199807311658.JAA02075@elmo.cygnus.com>you write:
  > Hi,
  > 
  >   I would like to submit the enclosed patch to reload1.c for
  > consideration.  The patch actually contains one real 'fix', and a
  > couple of spelling corrections.  The patch fixes a problem with
  > reloads for the Thumb toolchain.
  > 
  > The 'fix' is to the code that locates a register class to use for
  > base address reloads for SMALL_REGISTER_CLASSES machines.  If a class
  > cannot be found after removing the argument registers from BASE_REG_CLASS,
  > then a second attempt is made, this time removing the fixed registers
  > as well.  Since fixed registers cannot be used a spill registers this
  > should be OK. 
  > 
  > Cheers
  > 	Nick
  > 
  > 
  > Wed Jul 29 11:30:41 1998  Nick Clifton  <nickc@cygnus.com>
  > 
  > 	* reload1.c (init_reload): On SMALL_REGISTER_CLASSES machines,
  > 	when searching for a reload_address_base_reg_class, try avoiding
  > 	fixed registers as well as argument registers.
Can't you create a variable "base_no_args", which is a copy of the
base reg set minus the argument registers?

Then the loop looks like:
          GO_IF_HARD_REG_EQUAL (base, reg_class_contents[*p], usebase);
	  GO_IF_HARD_REG_EQUAL (base_no_args, ..., ...);
          continue;
        usebase:
          reload_address_base_reg_class = *p;
          break;

Seems simpler to me.


I would also suggest you do the same thing for index registers.  Even
if the thumb doesn't have them :-)  

jeff




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