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,

> On Thu, Oct 24, 2002 at 06:58:35AM -0400, Kazu Hirata wrote:
> > !        || (TARGET_H8300S && IN_RANGE (INTVAL (X) & 0xffffffff,	\
> > ! 				      0xffffff00, 0xffffffff))))
> 
> You've missed the point.
> 
> This code will claim that 0x1_0000_0000_0000 is a valid
> 8-bit constant.  You _cannot_ mask the value given.  You
> cannot compare against 32-bit constants.  You must compare
> the full HWI value against constants that sign-extend
> properly on any host.

Hmm.  I understand that on a 64-bit machine, a 32-bit address like
0xffff_ffff is sign-extended to 0xffff_ffff_ffff_ffff, but
EIGHTBIT_CONSTANT_ADDRESS_P is used only for integers originating from
4-byte integers.  So isn't is OK to simply mask the upper half?

Kazu Hirata


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