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]

PATCH for m68k.c


The function const_uint32_operand in m68k.c currently tests to see that
the integer is greater than zero.  However, unsigned ints that are
between 2^31 and 2^32-1 have a bit set in the most significant position
and they are incorrectly identified as negative numbers by the test
because INTVAL returns a signed quantity.  The proposed change is
modeled after the const_uint32_operand function in pa.c, which
eliminates this test.  The patch is attached to this mail and the log
file entry is below:

2001-02-23  Will Cohen  <wcohen@redhat.com>

	* config/m68k/m68k.c (const_uint32_operand): Removed range test.

Is it okay to apply this patch?

-Will Cohen
Index: m68k.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m68k/m68k.c,v
retrieving revision 1.39
diff -c -2 -p -r1.39 m68k.c
*** m68k.c	2001/02/04 22:44:12	1.39
--- m68k.c	2001/02/23 22:40:52
*************** const_uint32_operand (op, mode)
*** 3335,3339 ****
  	  && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL));
  #else
!   return ((GET_CODE (op) == CONST_INT && INTVAL (op) >= 0)
  	  || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0));
  #endif
--- 3335,3339 ----
  	  && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL));
  #else
!   return (GET_CODE (op) == CONST_INT
  	  || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0));
  #endif

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