tweak last patch
authorIan Lance Taylor <ian@airs.com>
Tue, 27 Jan 1998 17:33:35 +0000 (17:33 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 27 Jan 1998 17:33:35 +0000 (17:33 +0000)
gas/ChangeLog
gas/config/tc-arm.c

index 0d0f824..31bd282 100644 (file)
@@ -1,7 +1,8 @@
 Tue Jan 27 12:24:32 1998  Ian Lance Taylor  <ian@cygnus.com>
 
-       * config/tc-arm.c (md_apply_fix3): Add casts before comparing
-       offsetT variable set to unsigned int value with FAIL.
+       * config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold
+       validate_immediate return value in the right type for comparisons
+       to FAIL.
 
 Tue Jan 27 06:51:59 1998  Richard Henderson  <rth@cygnus.com>
 
index 93ac1ba..8beb8ac 100644 (file)
@@ -5036,6 +5036,7 @@ md_apply_fix3 (fixP, val, seg)
 {
   offsetT value = *val;
   offsetT newval;
+  unsigned int newimm;
   unsigned long temp;
   int sign;
   char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
@@ -5072,21 +5073,21 @@ md_apply_fix3 (fixP, val, seg)
   switch (fixP->fx_r_type)
     {
     case BFD_RELOC_ARM_IMMEDIATE:
-      newval = (offsetT) validate_immediate (value);
+      newimm = (offsetT) validate_immediate (value);
       temp = md_chars_to_number (buf, INSN_SIZE);
 
       /* If the instruction will fail, see if we can fix things up by
         changing the opcode.  */
-      if (newval == (offsetT) FAIL
-         && (newval = negate_data_op (&temp, value)) == (offsetT) FAIL)
+      if (newimm == (unsigned int) FAIL
+         && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL)
        {
          as_bad_where (fixP->fx_file, fixP->fx_line,
                        "invalid constant after fixup\n");
          break;
        }
 
-      newval |= (temp & 0xfffff000);
-      md_number_to_chars (buf, newval, INSN_SIZE);
+      newimm |= (temp & 0xfffff000);
+      md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
       break;
 
      case BFD_RELOC_ARM_OFFSET_IMM: