From: Ian Lance Taylor Date: Tue, 27 Jan 1998 17:33:35 +0000 (+0000) Subject: tweak last patch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29b2b5da9614ff9f7103e85913e8ba94a932bfba;p=binutils-gdb.git tweak last patch --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 0d0f8244e59..31bd282db64 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,7 +1,8 @@ Tue Jan 27 12:24:32 1998 Ian Lance Taylor - * 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 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 93ac1ba39d8..8beb8acacd6 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -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: