From d8731e7dad5a4451c4214cc99fe76ca0e2c4d9ff Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 1 May 2002 09:54:31 +0000 Subject: [PATCH] Generate warning if the same destination register is used in parallel instructions. --- gas/ChangeLog | 5 +++++ gas/config/tc-sh.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 76fe1393c80..76b97adf60d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2002-05-01 Arati Dikey + + * tc-sh.c (get_specific): Generate warning if the same + destination register is used in parallel instructions. + 2002-05-01 Andrew Macleod * config/tc-i386.c (extra_symbol_chars): Add '[' to the list. diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 1f33e10dbcf..61a38fddf88 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -1566,6 +1566,27 @@ get_specific (opcode, operands) sh_operand_info *user = operands + n; sh_arg_type arg = this_try->arg[n]; + /* If this is a parallel insn check to see if both + parts have the same destination register. */ + if ((n == 2) && (this_try->nibbles[0] == PPI)) + { + static boolean bIsPPI = false; + static int nLastDestReg; + + if (!bIsPPI) + { + bIsPPI = true; + nLastDestReg = user->reg; + } + else /* Second insn. */ + { + if (nLastDestReg == user->reg) + as_warn (_("destination register is same for parallel insns")); + + bIsPPI = false; + } + } + switch (arg) { case A_DISP_PC: -- 2.30.2