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]

reload_in/out register class constraints


On a new port, we have very annoyingly run out of letters to 
use for register classes (+ extra constraints).  Then it ocurred
that we needed another for use with reload_in/out patterns.

Now, it is a somewhat annoying feature of reload that this chosen
class must be a single letter, and cannot be the combination of
"abcde" or whatnot.  In our case, we actually needed ALL_REGS, and
it doesn't seem unreasonable to me to let the empty string match
this.  It'll save other ports (e.g. MIPS) the need to define such
a letter just for this case.

Originally tested on the new port; sanity checked on alpha.


r~


PS: We are in the process of re-organizing to reduce the number
of extra-constraints needed, but that's rather beside the point.


        * reload.c (push_secondary_reload): Accept empty-string for ALL_REGS.

Index: reload.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/reload.c,v
retrieving revision 1.201
diff -c -p -d -r1.201 reload.c
*** reload.c	2001/07/02 13:36:58	1.201
--- reload.c	2001/07/18 03:30:05
*************** push_secondary_reload (in_p, x, opnum, o
*** 372,382 ****
  	 in operand 1.  Outputs should have an initial "=", which we must
  	 skip.  */
  
!       char insn_letter
! 	= insn_data[(int) icode].operand[!in_p].constraint[in_p];
!       enum reg_class insn_class
! 	= (insn_letter == 'r' ? GENERAL_REGS
! 	   : REG_CLASS_FROM_LETTER ((unsigned char) insn_letter));
  
        if (insn_class == NO_REGS
  	  || (in_p
--- 372,389 ----
  	 in operand 1.  Outputs should have an initial "=", which we must
  	 skip.  */
  
!       enum reg_class insn_class;
! 
!       if (insn_data[(int) icode].operand[!in_p].constraint[0] == 0)
! 	insn_class = ALL_REGS;
!       else
! 	{
! 	  char insn_letter
! 	    = insn_data[(int) icode].operand[!in_p].constraint[in_p];
! 	  insn_class
! 	    = (insn_letter == 'r' ? GENERAL_REGS
! 	       : REG_CLASS_FROM_LETTER ((unsigned char) insn_letter));
! 	}
  
        if (insn_class == NO_REGS
  	  || (in_p


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