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]
Other format: [Raw text]

Re: [patch] h8300.h: Simplify sacro definitions.


Hi Richard,

> > !    && ((TARGET_H8300 && IN_RANGE (INTVAL (X) & 0xffff, 0xff00, 0xffff))
> > !        || (TARGET_H8300H && IN_RANGE (INTVAL (X), 0xffff00, 0xffffff))
> > !        || (TARGET_H8300S && IN_RANGE (INTVAL (X), 0xffffff00, 0xffffffff))))
> 
> This is incorrect.  This will cause cross-compilation from
> a 64-bit host to fail.

Thank you for pointing this out.  I committed the attached patch.

Kazu Hirata

2002-10-24  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Make it
	64-bit safe.
	(TINY_CONSTANT_ADDRESS_P): Likewise.

Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.106
diff -c -r1.106 h8300.h
*** h8300.h	21 Oct 2002 22:44:51 -0000	1.106
--- h8300.h	24 Oct 2002 10:39:59 -0000
***************
*** 825,835 ****
  /* Nonzero if X is a constant address suitable as an 8-bit absolute,
     which is a special case of the 'R' operand.  */
  
! #define EIGHTBIT_CONSTANT_ADDRESS_P(X)						\
!   ((GET_CODE (X) == CONST_INT)							\
!    && ((TARGET_H8300 && IN_RANGE (INTVAL (X) & 0xffff, 0xff00, 0xffff))		\
!        || (TARGET_H8300H && IN_RANGE (INTVAL (X), 0xffff00, 0xffffff))		\
!        || (TARGET_H8300S && IN_RANGE (INTVAL (X), 0xffffff00, 0xffffffff))))
  
  /* Nonzero if X is a constant address suitable as an 16-bit absolute
     on H8/300H and H8S.  */
--- 825,837 ----
  /* Nonzero if X is a constant address suitable as an 8-bit absolute,
     which is a special case of the 'R' operand.  */
  
! #define EIGHTBIT_CONSTANT_ADDRESS_P(X)					\
!   ((GET_CODE (X) == CONST_INT)						\
!    && ((TARGET_H8300 && IN_RANGE (INTVAL (X) & 0xffff, 0xff00, 0xffff))	\
!        || (TARGET_H8300H && IN_RANGE (INTVAL (X) & 0xffffffff,		\
! 				      0xffff00, 0xffffff))		\
!        || (TARGET_H8300S && IN_RANGE (INTVAL (X) & 0xffffffff,		\
! 				      0xffffff00, 0xffffffff))))
  
  /* Nonzero if X is a constant address suitable as an 16-bit absolute
     on H8/300H and H8S.  */
***************
*** 837,847 ****
  #define TINY_CONSTANT_ADDRESS_P(X)					\
    ((GET_CODE (X) == CONST_INT)						\
     && ((TARGET_H8300H							\
! 	&& (IN_RANGE (INTVAL (X), 0x000000, 0x007fff)			\
! 	    || IN_RANGE (INTVAL (X), 0xff8000, 0xffffff)))		\
         || (TARGET_H8300S						\
! 	   && (IN_RANGE (INTVAL (X), 0x00000000, 0x00007fff)		\
! 	       || IN_RANGE (INTVAL (X), 0xffff8000, 0xffffffff)))))
  
  /* 'U' if valid for a bset destination;
     i.e. a register, register indirect, or the eightbit memory region
--- 839,851 ----
  #define TINY_CONSTANT_ADDRESS_P(X)					\
    ((GET_CODE (X) == CONST_INT)						\
     && ((TARGET_H8300H							\
! 	&& (IN_RANGE (INTVAL (X) & 0xffffffff, 0x000000, 0x007fff)	\
! 	    || IN_RANGE (INTVAL (X) & 0xffffffff, 0xff8000, 0xffffff)))	\
         || (TARGET_H8300S						\
! 	   && (IN_RANGE (INTVAL (X) & 0xffffffff,			\
! 			 0x00000000, 0x00007fff)			\
! 	       || IN_RANGE (INTVAL (X) & 0xffffffff,			\
! 			    0xffff8000, 0xffffffff)))))
  
  /* 'U' if valid for a bset destination;
     i.e. a register, register indirect, or the eightbit memory region


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