From 114502711bc334a6c530a544033d4769c0703c70 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 16 Aug 1999 17:47:29 +0000 Subject: [PATCH] Look for register conflicts on stores as well as loads. --- gas/ChangeLog | 5 +++++ gas/config/tc-arm.c | 35 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 421d3c6..c47013a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +1999-08-16 Nick Clifton + + * config/tc-arm.c (do_ldst): Look for register conflicts on stores + as well as loads. + 1999-08-13 Nick Clifton * config/tc-arm.c (validate_offset_imm): Work on unsigned values. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 0f0cd70..b5d8f3d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -2853,22 +2853,23 @@ do_ldst (str, flags) if ((reg = reg_required_here (&str, 16)) == FAIL) return; - conflict_reg = (((conflict_reg == reg) - && (inst.instruction & LOAD_BIT)) - ? 1 : 0); + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); skip_whitespace (str); if (*str == ']') { - str++; + str ++; + if (skip_past_comma (&str) == SUCCESS) { /* [Rn],... (post inc) */ if (ldst_extend (&str, halfword) == FAIL) return; if (conflict_reg) - as_warn (_("destination register same as write-back base\n")); + as_warn (_("%s register same as write-back base"), + (inst.instruction & LOAD_BIT) ? _("destination") : _("source") ); } else { @@ -2881,7 +2882,8 @@ do_ldst (str, flags) if (*str == '!') { if (conflict_reg) - as_warn (_("destination register same as write-back base\n")); + as_warn (_("%s register same as write-back base"), + (inst.instruction & LOAD_BIT) ? _("destination") : _("source") ); str++; inst.instruction |= WRITE_BACK; } @@ -2917,7 +2919,8 @@ do_ldst (str, flags) if (*str == '!') { if (conflict_reg) - as_tsktsk (_("destination register same as write-back base\n")); + as_warn (_("%s register same as write-back base"), + (inst.instruction & LOAD_BIT) ? _("destination") : _("source") ); str++; inst.instruction |= WRITE_BACK; } @@ -5340,7 +5343,7 @@ md_apply_fix3 (fixP, val, seg) && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL) { as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid constant (%lx) after fixup\n"), + _("invalid constant (%lx) after fixup"), (unsigned long) value); break; } @@ -5374,7 +5377,7 @@ md_apply_fix3 (fixP, val, seg) else { as_bad_where (fixP->fx_file, fixP->fx_line, - _("Unable to compute ADRL instructions for PC offset of 0x%x\n"), value); + _("Unable to compute ADRL instructions for PC offset of 0x%x"), value); break; } @@ -5422,7 +5425,7 @@ md_apply_fix3 (fixP, val, seg) { if (fixP->fx_r_type == BFD_RELOC_ARM_HWLITERAL) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid literal constant: pool needs to be closer\n")); + _("invalid literal constant: pool needs to be closer")); else as_bad (_("bad immediate value for half-word offset (%ld)"), (long) value); break; @@ -5443,7 +5446,7 @@ md_apply_fix3 (fixP, val, seg) if (validate_offset_imm (value, 0) == FAIL) { as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid literal constant: pool needs to be closer\n")); + _("invalid literal constant: pool needs to be closer")); break; } @@ -5797,7 +5800,7 @@ md_apply_fix3 (fixP, val, seg) case BFD_RELOC_NONE: default: as_bad_where (fixP->fx_file, fixP->fx_line, - _("Bad relocation fixup type (%d)\n"), fixP->fx_r_type); + _("Bad relocation fixup type (%d)"), fixP->fx_r_type); } return 1; @@ -6217,13 +6220,9 @@ _("Warning: Use of the 'nv' conditional is deprecated\n")); if (reg == FAIL) { if (regnum != FAIL) - { - insert_reg_alias (str, regnum); - } + insert_reg_alias (str, regnum); else - { - as_warn (_("register '%s' does not exist\n"), q); - } + as_warn (_("register '%s' does not exist"), q); } else if (regnum != FAIL) { -- 2.7.4