2009-11-11 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 12 Nov 2009 02:21:46 +0000 (02:21 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 12 Nov 2009 02:21:46 +0000 (02:21 +0000)
* config/tc-i386.c (build_modrm_byte): Don't set register
operand twice.

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

index a372f9a5c307fd4d4a7f6c0b9364ddf5934c6f8b..c239616a60706e4a9b7f01a3345fc5393bc5eb0c 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/tc-i386.c (build_modrm_byte): Don't set register
+       operand twice.
+
 2009-11-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * configure.in: Call ACX_LARGEFILE.  Stop calling AC_SYS_LARGEFILE.
index 2996751e5442005b068e5e4c347ea715d982765e..e787215ccca6114a981e95f2cb921f5ffc640637 100644 (file)
@@ -5344,19 +5344,23 @@ build_modrm_byte (void)
              i.vex.register_specifier = i.op[vex_reg].regs;
            }
 
-         /* If there is an extension opcode to put here, the
-            register number must be put into the regmem field.  */
-         if (i.tm.extension_opcode != None)
+         /* Don't set OP operand twice.  */
+         if (vex_reg != op)
            {
-             i.rm.regmem = i.op[op].regs->reg_num;
-             if ((i.op[op].regs->reg_flags & RegRex) != 0)
-               i.rex |= REX_B;
-           }
-         else
-           {
-             i.rm.reg = i.op[op].regs->reg_num;
-             if ((i.op[op].regs->reg_flags & RegRex) != 0)
-               i.rex |= REX_R;
+             /* If there is an extension opcode to put here, the
+                register number must be put into the regmem field.  */
+             if (i.tm.extension_opcode != None)
+               {
+                 i.rm.regmem = i.op[op].regs->reg_num;
+                 if ((i.op[op].regs->reg_flags & RegRex) != 0)
+                   i.rex |= REX_B;
+               }
+             else
+               {
+                 i.rm.reg = i.op[op].regs->reg_num;
+                 if ((i.op[op].regs->reg_flags & RegRex) != 0)
+                   i.rex |= REX_R;
+               }
            }
 
          /* Now, if no memory operand has set i.rm.mode = 0, 1, 2 we