[patch] h8300.h: Simplify sacro definitions.

Kazu Hirata kazu@cs.umass.edu
Wed Oct 30 03:23:00 GMT 2002


Hi Dhananjay,


> This will fail for H8300 ( even on 32 bit host ). You may have to
> truncate n1 and n2 for HImode instead of SImode. For H8300 address
> is 16 bit so constant address 0xFFXX is sign extended to 0xFFFFFFXX
> and will not be in range (0x0000FF00, 0x0000FFFF).

Oops.  I am really messed up on this patch...  Thanks for pointing
this out.

Kazu Hirata

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

	* config/h8300/h8300.c (h8300_eightbit_constant_address_p):
	Truncate the addresses for H8/300 using HImode.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.153
diff -c -r1.153 h8300.c
*** h8300.c	29 Oct 2002 17:55:45 -0000	1.153
--- h8300.c	30 Oct 2002 11:17:44 -0000
***************
*** 3862,3869 ****
       rtx x;
  {
    /* The ranges the 8-bit area. */
!   const unsigned HOST_WIDE_INT n1 = trunc_int_for_mode (0x0000ff00, SImode);
!   const unsigned HOST_WIDE_INT n2 = trunc_int_for_mode (0x0000ffff, SImode);
    const unsigned HOST_WIDE_INT h1 = trunc_int_for_mode (0x00ffff00, SImode);
    const unsigned HOST_WIDE_INT h2 = trunc_int_for_mode (0x00ffffff, SImode);
    const unsigned HOST_WIDE_INT s1 = trunc_int_for_mode (0xffffff00, SImode);
--- 3862,3869 ----
       rtx x;
  {
    /* The ranges the 8-bit area. */
!   const unsigned HOST_WIDE_INT n1 = trunc_int_for_mode (0xff00, HImode);
!   const unsigned HOST_WIDE_INT n2 = trunc_int_for_mode (0xffff, HImode);
    const unsigned HOST_WIDE_INT h1 = trunc_int_for_mode (0x00ffff00, SImode);
    const unsigned HOST_WIDE_INT h2 = trunc_int_for_mode (0x00ffffff, SImode);
    const unsigned HOST_WIDE_INT s1 = trunc_int_for_mode (0xffffff00, SImode);



More information about the Gcc-patches mailing list