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]

regclass register preferencing patch


	Below is a proposed patch for a register preferencing bug.  The
current implementation cannot handle numeric constraints referring to
earlier constraints if the constraint has a modifier.

	Two strange things about the current algorithm: 1) It only gives
special treatment to correctly handle a numeric constraint if only one
numeric constraint is present and if it is the first constraint.  2) The
main loop to scan constraints below this special handling only provides
switch statement cases for references to five earlier constraints in the
same pattern.

David


Index: regclass.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/regclass.c,v
retrieving revision 1.34
diff -c -p -r1.34 regclass.c
*** regclass.c	1998/10/17 01:28:54	1.34
--- regclass.c	1998/10/20 17:32:13
*************** record_reg_classes (n_alts, n_ops, ops, 
*** 1160,1168 ****
  	      continue;
  	    }
  
! 	  if (*p == '%')
! 	    p++;
  
  	  /* If this alternative is only relevant when this operand
  	     matches a previous operand, we do different things depending
  	     on whether this operand is a pseudo-reg or not.  */
--- 1160,1177 ----
  	      continue;
  	    }
  
! 	  /* Ascertain modifiers for line and skip any modifiers that might
! 	     occur before first constraint.  */
! 	  while (*p == '%' || *p == '=' || *p == '+' || *p == '&')
! 	    {
! 	      if (*p == '=')
! 		op_types[i] = OP_WRITE;
! 	      else if (*p == '+')
! 		op_types[i] = OP_READ_WRITE;
  
+ 	      p++;
+ 	    }
+ 
  	  /* If this alternative is only relevant when this operand
  	     matches a previous operand, we do different things depending
  	     on whether this operand is a pseudo-reg or not.  */
*************** record_reg_classes (n_alts, n_ops, ops, 
*** 1235,1248 ****
  	  while (*p && (c = *p++) != ',')
  	    switch (c)
  	      {
- 	      case '=':
- 		op_types[i] = OP_WRITE;
- 		break;
- 
- 	      case '+':
- 		op_types[i] = OP_READ_WRITE;
- 		break;
- 
  	      case '*':
  		/* Ignore the next letter for this pass.  */
  		p++;
--- 1244,1249 ----
*************** record_reg_classes (n_alts, n_ops, ops, 
*** 1250,1258 ****
  
  	      case '?':
  		alt_cost += 2;
- 	      case '%':
  	      case '!':  case '#':
- 	      case '&':
  	      case '0':  case '1':  case '2':  case '3':  case '4':
  	      case 'p':
  		break;
--- 1251,1257 ----


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