aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2010-12-09 23:43:32 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2010-12-09 23:43:32 +0000
commitd5818fca0b88898c09ba162522931ccd71d8fce5 (patch)
tree22d9d0c9be2a3979f152a8c4c0059080b0294a31 /gas
parent1d845dc12456a4f3c3aaf3dd7697dd5befa66858 (diff)
downloadgdb-d5818fca0b88898c09ba162522931ccd71d8fce5.zip
gdb-d5818fca0b88898c09ba162522931ccd71d8fce5.tar.gz
gdb-d5818fca0b88898c09ba162522931ccd71d8fce5.tar.bz2
* config/tc-mips.c (macro) <M_DEXT, M_DINS>: Correct types used
for pos and size.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c29
2 files changed, 21 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f87b622..e018505 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2010-12-09 Maciej W. Rozycki <macro@codesourcery.com>
+ * config/tc-mips.c (macro) <M_DEXT, M_DINS>: Correct types used
+ for pos and size.
+
+2010-12-09 Maciej W. Rozycki <macro@codesourcery.com>
+
* config/tc-mips.c (macro) <ld_st>: Don't load a zero into an
auxiliary register when using a signed 16-bit constant offset.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index eb1ba2e..045cf87 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -5262,8 +5262,9 @@ macro (struct mips_cl_insn *ip)
case M_DEXT:
{
- unsigned long pos;
- unsigned long size;
+ /* Use unsigned arithmetic. */
+ addressT pos;
+ addressT size;
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
{
@@ -5272,19 +5273,19 @@ macro (struct mips_cl_insn *ip)
}
else
{
- pos = (unsigned long) imm_expr.X_add_number;
- size = (unsigned long) imm2_expr.X_add_number;
+ pos = imm_expr.X_add_number;
+ size = imm2_expr.X_add_number;
}
if (pos > 63)
{
- as_bad (_("Improper position (%lu)"), pos);
+ as_bad (_("Improper position (%lu)"), (unsigned long) pos);
pos = 1;
}
if (size == 0 || size > 64 || (pos + size - 1) > 63)
{
as_bad (_("Improper extract size (%lu, position %lu)"),
- size, pos);
+ (unsigned long) size, (unsigned long) pos);
size = 1;
}
@@ -5303,14 +5304,16 @@ macro (struct mips_cl_insn *ip)
s = "dextm";
fmt = "t,r,+A,+G";
}
- macro_build ((expressionS *) NULL, s, fmt, treg, sreg, pos, size - 1);
+ macro_build ((expressionS *) NULL, s, fmt, treg, sreg, (int) pos,
+ (int) (size - 1));
}
break;
case M_DINS:
{
- unsigned long pos;
- unsigned long size;
+ /* Use unsigned arithmetic. */
+ addressT pos;
+ addressT size;
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
{
@@ -5319,19 +5322,19 @@ macro (struct mips_cl_insn *ip)
}
else
{
- pos = (unsigned long) imm_expr.X_add_number;
- size = (unsigned long) imm2_expr.X_add_number;
+ pos = imm_expr.X_add_number;
+ size = imm2_expr.X_add_number;
}
if (pos > 63)
{
- as_bad (_("Improper position (%lu)"), pos);
+ as_bad (_("Improper position (%lu)"), (unsigned long) pos);
pos = 1;
}
if (size == 0 || size > 64 || (pos + size - 1) > 63)
{
as_bad (_("Improper insert size (%lu, position %lu)"),
- size, pos);
+ (unsigned long) size, (unsigned long) pos);
size = 1;
}