aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1998-07-28 17:03:05 +0000
committerJeff Law <law@redhat.com>1998-07-28 17:03:05 +0000
commit711eeac0eb83f0d9e8ef5b0dfbc5d932725aabc8 (patch)
treedb8823c671159c9b7dbf16d7803dc85e50a37b62 /gas
parent9509185b58f08cd8414b1817d20297158756d40a (diff)
downloadgdb-711eeac0eb83f0d9e8ef5b0dfbc5d932725aabc8.zip
gdb-711eeac0eb83f0d9e8ef5b0dfbc5d932725aabc8.tar.gz
gdb-711eeac0eb83f0d9e8ef5b0dfbc5d932725aabc8.tar.bz2
* config/tc-mn10300.c (md_assemble): Fix "errmsg" initialization
to work with internationalization code. Issue an error when two operands match that are not allowed to match.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-mn10300.c45
2 files changed, 49 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a0551af..a54ab3a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 28 11:01:21 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10300.c (md_assemble): Fix "errmsg" initialization
+ to work with internationalization code. Issue an error when two
+ operands match that are not allowed to match.
+
Mon Jul 27 16:25:58 1998 Doug Evans <devans@canuck.cygnus.com>
* configure.in (install_tooldir): Allow target to specify whether
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 1dd5803..1389a9b 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -105,6 +105,10 @@ struct mn10300_fixup
};
struct mn10300_fixup fixups[MAX_INSN_FIXUPS];
static int fc;
+
+/* We must store the value of each register operand so that we can
+ verify that certain registers do not match. */
+int mn10300_reg_operands[MN10300_MAX_OPERANDS];
const char *md_shortopts = "";
struct option md_longopts[] = {
@@ -878,7 +882,7 @@ md_begin ()
/* This is both a simplification (we don't have to write md_apply_fix)
and support for future optimizations (branch shortening and similar
- stuff in the linker. */
+ stuff in the linker). */
linkrelax = 1;
/* Set the default machine type. */
@@ -924,12 +928,17 @@ md_assemble (str)
for(;;)
{
- const char *errmsg = "Invalid opcode/operands";
+ const char *errmsg;
int op_idx;
char *hold;
int extra_shift = 0;
+ errmsg = _("Invalid opcode/operands");
+
+ /* Reset the array of register operands. */
+ memset (mn10300_reg_operands, -1, sizeof (mn10300_reg_operands));
+
relaxable = 0;
fc = 0;
match = 0;
@@ -1330,6 +1339,9 @@ md_assemble (str)
ex.X_add_number, (char *) NULL,
0, extra_shift);
+
+ /* And note the register number in the register array. */
+ mn10300_reg_operands[op_idx - 1] = ex.X_add_number;
break;
}
@@ -1384,6 +1396,35 @@ keep_going:
if (*str != ',')
match = 1;
+ /* If this instruction has registers that must not match, verify
+ that they do indeed not match. */
+ if (opcode->no_match_operands)
+ {
+ int i;
+
+ /* Look at each operand to see if it's marked. */
+ for (i = 0; i < MN10300_MAX_OPERANDS; i++)
+ {
+ if ((1 << i) & opcode->no_match_operands)
+ {
+ int j;
+
+ /* operand I is marked. Check that it does not match any
+ operands > I which are marked. */
+ for (j = i + 1; j < MN10300_MAX_OPERANDS; j++)
+ {
+ if (((1 << j) & opcode->no_match_operands)
+ && mn10300_reg_operands[i] == mn10300_reg_operands[j])
+ {
+ errmsg = _("Invalid register specification.");
+ match = 0;
+ goto error;
+ }
+ }
+ }
+ }
+ }
+
error:
if (match == 0)
{