aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-02-10 12:21:43 +0000
committerNick Clifton <nickc@redhat.com>2006-02-10 12:21:43 +0000
commit70e45ad9bb4476368d66997ec0df94abc9d3a2de (patch)
tree86d09865a9fecdf2c27a1330f67fbb2e1a945cb8 /gas
parent52de4c065504bb947eb0f78d46f2beece782fd97 (diff)
downloadgdb-70e45ad9bb4476368d66997ec0df94abc9d3a2de.zip
gdb-70e45ad9bb4476368d66997ec0df94abc9d3a2de.tar.gz
gdb-70e45ad9bb4476368d66997ec0df94abc9d3a2de.tar.bz2
(check_range): Ensure that the sign bit of a 32-bit value is propagated into
the upper bits of a 64-bit long.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog3
-rw-r--r--gas/config/tc-crx.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3728571..b248cb8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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.
diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
index 9b0b856..34448cd 100644
--- a/gas/config/tc-crx.c
+++ b/gas/config/tc-crx.c
@@ -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)
{