This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: 64-bit host failures, crx


On Mon, Feb 27, 2012 at 06:37:16AM -0500, Hans-Peter Nilsson wrote:
> The type uint32_t is exactly 32 bits, modulo compiler bugs.

Thanks for the wake-up.  Let's get rid of the useless code.

	* config/tc-crx.c (check_range): Correct uint32_t misconceptions.

Index: gas/config/tc-crx.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-crx.c,v
retrieving revision 1.26
diff -u -p -r1.26 tc-crx.c
--- gas/config/tc-crx.c	27 Feb 2012 06:37:40 -0000	1.26
+++ gas/config/tc-crx.c	27 Feb 2012 12:29:18 -0000
@@ -1331,9 +1331,6 @@ check_range (long *num, int bits, int un
   uint32_t upper_64kb = 0xffff0000;
   uint32_t value = *num;
 
-  /* Trim all values to 32 bits.  uint32_t can be more than 32 bits.  */
-  value &= 0xffffffff;
-
   /* Verify operand value is even.  */
   if (flags & OP_EVEN)
     {
@@ -1361,7 +1358,7 @@ check_range (long *num, int bits, int un
 	 value is implementation defined.  See ISO C 6.5.7.  So we use
 	 an unsigned type and sign extend afterwards.  */
       value >>= 1;
-      value = ((value ^ 0x40000000) - 0x40000000) & 0xffffffff;
+      value = (value ^ 0x40000000) - 0x40000000;
       if (update)
 	*num = value;
     }
@@ -1407,7 +1404,7 @@ check_range (long *num, int bits, int un
 
       for (bin = 0; bin < cst4_maps; bin++)
 	{
-	  if (value == ((uint32_t) cst4_map[bin] & 0xffffffff))
+	  if (value == (uint32_t) cst4_map[bin])
 	    {
 	      is_cst4 = 1;
 	      if (update)

-- 
Alan Modra
Australia Development Lab, IBM


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