]> Git Repo - binutils.git/commitdiff
Fix register name printed in warning message.
authorAlan Modra <[email protected]>
Mon, 19 Mar 2001 11:28:20 +0000 (11:28 +0000)
committerAlan Modra <[email protected]>
Mon, 19 Mar 2001 11:28:20 +0000 (11:28 +0000)
gas/ChangeLog
gas/config/tc-i386.c
include/opcode/ChangeLog
include/opcode/i386.h

index 3f41a1892c2bdf2803704d8c41a2950fccf6f3c2..054e911dbde0d4bf7732d147d327b46f46706962 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-19  Alan Modra  <[email protected]>
+
+       * config/tc-i386.c (md_assemble <REGISTER_WARNINGS>): Correct
+       used register name.
+
 2001-03-18  Stephane Carrez  <[email protected]>
 
        * config/tc-m68hc11.c (md_pseudo_table): Recognize xrefb to comply
index 74e5e13a7d946b0a99027fae0506113572179eb4..585aa8d97ef8dba012599d5eb48e5ddb53e7902f 100644 (file)
@@ -1996,7 +1996,10 @@ md_assemble (line)
                    if (!quiet_warnings
                        && (i.tm.operand_types[op] & InOutPortReg) == 0)
                      as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-                              (i.op[op].regs - (i.types[op] & Reg16 ? 8 : 16))->reg_name,
+                              (i.op[op].regs
+                               + (i.types[op] & Reg16
+                                  ? REGNAM_AL - REGNAM_AX
+                                  : REGNAM_AL - REGNAM_EAX))->reg_name,
                               i.op[op].regs->reg_name,
                               i.suffix);
 #endif
@@ -2046,7 +2049,7 @@ md_assemble (line)
 #if REGISTER_WARNINGS
                  else
                    as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-                            (i.op[op].regs + 8)->reg_name,
+                            (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name,
                             i.op[op].regs->reg_name,
                             i.suffix);
 #endif
@@ -2117,7 +2120,7 @@ md_assemble (line)
                  else
 #if REGISTER_WARNINGS
                    as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-                            (i.op[op].regs - 8)->reg_name,
+                            (i.op[op].regs + REGNAM_AX - REGNAM_EAX)->reg_name,
                             i.op[op].regs->reg_name,
                             i.suffix);
 #endif
index ce268211d017375958d8add439dd2da513904fa5..eef5c4dc6fd86a01ddc92becfde1e2f64cbc7fce 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-19  Alan Modra  <[email protected]>
+
+       * i386.h (REGNAM_AL, REGNAM_AX, REGNAM_EAX): Define.
+
 2001-02-28  Igor Shevlyakov  <[email protected]>
 
        * m68k.h: new defines for Coldfire V4. Update mcf to know
index 1af44fb01baf87ce7819cfdf8739f45c2581f0aa..f480dd4003efeeeb6ad9c70660102fb418800e79 100644 (file)
@@ -1340,6 +1340,7 @@ static const reg_entry i386_regtab[] = {
   /* make %st first as we test for it */
   {"st", FloatReg|FloatAcc, 0, 0},
   /* 8 bit regs */
+#define REGNAM_AL 1            /* Entry in i386_regtab.  */
   {"al", Reg8|Acc, 0, 0},
   {"cl", Reg8|ShiftCount, 0, 1},
   {"dl", Reg8, 0, 2},
@@ -1365,6 +1366,7 @@ static const reg_entry i386_regtab[] = {
   {"r14b", Reg8, RegRex64|RegRex, 6},
   {"r15b", Reg8, RegRex64|RegRex, 7},
   /* 16 bit regs */
+#define REGNAM_AX 25
   {"ax", Reg16|Acc, 0, 0},
   {"cx", Reg16, 0, 1},
   {"dx", Reg16|InOutPortReg, 0, 2},
@@ -1382,6 +1384,7 @@ static const reg_entry i386_regtab[] = {
   {"r14w", Reg16, RegRex, 6},
   {"r15w", Reg16, RegRex, 7},
   /* 32 bit regs */
+#define REGNAM_EAX 41
   {"eax", Reg32|BaseIndex|Acc, 0, 0},  /* Must be in ax + 16 slot */
   {"ecx", Reg32|BaseIndex, 0, 1},
   {"edx", Reg32|BaseIndex, 0, 2},
This page took 0.077435 seconds and 4 git commands to generate.