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: AM33: Use macros instead of register number constants


 In message <oraeif5eb2.fsf@zecarneiro.lsd.ic.unicamp.br>you write:
  > 
  > Index: gcc/ChangeLog
  > from  Alexandre Oliva  <aoliva@cygnus.com>
  > 
  > 	* config/mn10300/mn10300.h (FIRST_DATA_REG, LAST_DATA_REG,
  > 	FIRST_ADDRESS_REG, LAST_ADDRESS_REG, FIRST_EXTENDED_REG,
  > 	LAST_EXTENDED_REG): New macros.
  > 	(REGNO_SP_P): Redefine in terms of STACK_POINTER_REGNUM.
  > 	(REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_EXTENDED_P,
  > 	REGNO_AM33_P): Redefine in terms of the new macros.
  > 	(CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise.
  > 	(FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
  > 	STRUCT_VALUE): Likewise.
  > 
  > Index: gcc/config/mn10300/mn10300.h
  > ===================================================================
  > RCS file: /cvs/cvsfiles/devo/gcc/config/mn10300/mn10300.h,v
  > retrieving revision 1.73
  > diff -u -r1.73 mn10300.h
  > --- gcc/config/mn10300/mn10300.h	2000/04/27 12:01:37	1.73
  > +++ gcc/config/mn10300/mn10300.h	2000/04/27 22:27:10
  > @@ -169,6 +169,7 @@
  >  {						\
  >    if (!TARGET_AM33)				\
  >      {						\
  > -      for (i = 10; i < 18; i++) 		\
  > +      for (i = FIRST_EXTENDED_REG; 		\
  > +	   i < LAST_EXTENDED_REG; i++) 		\
  >  	fixed_regs[i] = call_used_regs[i] = 1; 	\
LAST_EXTENDED_REG is defined as 17.  So either the original loop was wrong,
the new loop is wrong, or LAST_EXTENDED_REG is wrong.  Given how you adjusted
other case, I suspect you wanted that to be
i <= LAST_EXTENDED_REG.

You should probably move the definitions of those macros before their
first uses.

Otherwise it seems OK.

jeff


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