Generate warning if the same destination register is used in parallel
authorNick Clifton <nickc@redhat.com>
Wed, 1 May 2002 09:54:31 +0000 (09:54 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 1 May 2002 09:54:31 +0000 (09:54 +0000)
instructions.

gas/ChangeLog
gas/config/tc-sh.c

index 76fe1393c801a176eed486405a367fb1bb5e2981..76b97adf60d0f48cd768b36ddeee2016b867167d 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-01  Arati Dikey <aratid@kpit.com>
+
+       * tc-sh.c (get_specific): Generate warning if the same
+       destination register is used in parallel instructions.
+
 2002-05-01  Andrew Macleod  <amacleod@cygnus.com>
 
        * config/tc-i386.c (extra_symbol_chars): Add '[' to the list.
index 1f33e10dbcfa0b92ea4846ead37060e1bcfea8e6..61a38fddf88624607063073bbb2fd3f3b38e5252 100644 (file)
@@ -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: