]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
(check_range): Ensure that the sign bit of a 32-bit value is propagated into
authorNick Clifton <nickc@redhat.com>
Fri, 10 Feb 2006 12:21:43 +0000 (12:21 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 10 Feb 2006 12:21:43 +0000 (12:21 +0000)
the upper bits of a 64-bit long.

gas/ChangeLog
gas/config/tc-crx.c

index 372857153356fd26ec42584d9af2e88e0a294780..b248cb822d3605f67f63d7423611cc612e1e4e5d 100644 (file)
@@ -1,5 +1,8 @@
 2006-02-10  Nick Clifton  <nickc@redhat.com>
 
+       * config/tc-crx.c (check_range): Ensure that the sign bit of a
+       32-bit value is propagated into the upper bits of a 64-bit long.
+
        * config/tc-arc.c (init_opcode_tables): Fix cast.
        (arc_extoper, md_operand): Likewise.
 
index 9b0b8564c8d00a33146f4e2fbe079bc7b029aff1..34448cd8dca7a54341d7795f7d0d96eac0352675 100644 (file)
@@ -1378,6 +1378,12 @@ check_range (long *num, int bits, int unsigned flags, int update)
   long upper_64kb = 0xFFFF0000;
   long value = *num;
 
+  /* For hosts witah longs bigger than 32-bits make sure that the top 
+     bits of a 32-bit negative value read in by the parser are set,
+     so that the correct comparisons are made.  */
+  if (value & 0x80000000)
+    value |= (-1L << 31);
+
   /* Verify operand value is even.  */
   if (flags & OP_EVEN)
     {