It is permissible for the source and destination operands of TFR and EXG to be
the same register. However it is a pointless instruction and anyone writing it
has probably made a mistake. This change emits a warning if such an instruction
is encountered.
gas/
* config/tc-s12z.c (tfr): Emit warning if operands are the same.
* testsuite/gas/s12z/exg.d: New test case.
* testsuite/gas/s12z/exg.l: New file.
+2019-01-31 John Darrington <john@darrington.wattle.id.au>
+
+ * config/tc-s12z.c (tfr): Emit warning if operands are the same.
+ * testsuite/gas/s12z/exg.d: New test case.
+ * testsuite/gas/s12z/exg.l: New file.
+
2019-01-31 John Darrington <john@darrington.wattle.id.au>
* config/tc-s12z.c (lex_opr): Add a parameter to indicate whether
&& (registers[reg2].bytes <= registers[reg1].bytes))
as_warn (_("Source register for %s is no larger than the destination register"),
insn->name);
+ else if (reg1 == reg2)
+ as_warn (_("The destination and source registers are identical"));
char *f = s12z_new_insn (1 + insn->page);
if (insn->page == 2)
#objdump: -d
#name:
#source: exg.s
+#warning_output: exg.l
.*: file format elf32-s12z
--- /dev/null
+.*: Assembler messages:
+.*:2: Warning: The destination and source registers are identical