]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix register name printed in warning message.
authorAlan Modra <amodra@gmail.com>
Mon, 19 Mar 2001 11:34:55 +0000 (11:34 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 19 Mar 2001 11:34:55 +0000 (11:34 +0000)
gas/ChangeLog
gas/config/tc-i386.c
include/opcode/ChangeLog
include/opcode/i386.h

index 68aeedc174ac0797d50d7dffd3747fb6e2618077..6eb8d3c6740126906dc486b73467a03f71112ad7 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-19  Alan Modra  <alan@linuxcare.com.au>
+
+       * config/tc-i386.c (md_assemble <REGISTER_WARNINGS>): Correct
+       used register name.
+
 2001-03-18  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * config/tc-m68hc11.c (md_pseudo_table): Recognize xrefb to comply
index ffcfabe6c70a2a31e172ff4516b273987558e9bd..6e9fda2b9168876be1872496d760594f1ee338be 100644 (file)
@@ -1962,7 +1962,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
@@ -2012,7 +2015,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
@@ -2083,7 +2086,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 63aa1cb80fe370ccfc7a72990cdb9b5daadd83ee..cff7d202d6e4055cb4f531d8028945ed81180136 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-19  Alan Modra  <alan@linuxcare.com.au>
+
+       * i386.h (REGNAM_AL, REGNAM_AX, REGNAM_EAX): Define.
+
 Mon Feb 12 17:39:31 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.h (i386_optab): SSE integer converison instructions have
index 2ab783e63f74d424567c05565da0d73f19cef12e..24c38971c81be2551cb55f113833744d3c16fea7 100644 (file)
@@ -1339,6 +1339,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},
@@ -1364,6 +1365,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},
@@ -1381,6 +1383,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},