+2020-01-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/25438
+ * config/tc-i386.c (check_long_reg): Always disallow double word
+ suffix in mnemonic with word general register.
+ * testsuite/gas/i386/general.s: Replace word general register
+ with double word general register for movl.
+ * testsuite/gas/i386/inval.s: Add tests for movl with word general
+ register.
+ * testsuite/gas/i386/general.l: Updated.
+ * testsuite/gas/i386/inval.l: Likewise.
+
2020-01-22 Alan Modra <amodra@gmail.com>
* config/tc-ppc.c (parse_tls_arg): Handle tls arg for
i.suffix);
return 0;
}
- /* Warn if the e prefix on a general reg is missing. */
- else if ((!quiet_warnings || flag_code == CODE_64BIT)
- && i.types[op].bitfield.word
+ /* Error if the e prefix on a general reg is missing. */
+ else if (i.types[op].bitfield.word
&& (i.tm.operand_types[op].bitfield.class == Reg
|| i.tm.operand_types[op].bitfield.instance == Accum)
&& i.tm.operand_types[op].bitfield.dword)
{
- /* Prohibit these changes in the 64bit mode, since the
- lowering is more complicated. */
- if (flag_code == CODE_64BIT)
- {
- as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
-#if REGISTER_WARNINGS
- as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
- register_prefix,
- (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name,
- register_prefix, i.op[op].regs->reg_name, i.suffix);
-#endif
+ as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
+ register_prefix, i.op[op].regs->reg_name,
+ i.suffix);
+ return 0;
}
/* Warn if the r prefix on a general reg is present. */
else if (i.types[op].bitfield.qword
.*:25: Warning:.*
.*:27: Warning:.*
.*:29: Warning:.*
-.*:39: Warning:.*
-.*:41: Warning:.*
.*:48: Warning:.*
.*:51: Warning:.*
.*:124: Warning:.*
.*:142: Warning:.*
.*:143: Warning:.*
.*:144: Warning:.*
-.*:178: Warning:.*
.*:224: Warning:.*
.*:233: Warning:.*
.*:234: Warning:.*
36 007e 1F popl %ds
37 007f 8CD8 mov %ds,%eax
38 0081 8CD8 movl %ds,%eax
- 39 0083 8CD8 movl %ds,%ax
-.*Warning:.*
+ 39 0083 8CDB movl %ds,%ebx
40 0085 8ED8 mov %eax,%ds
- 41 0087 8ED8 movl %ax,%ds
-.*Warning:.*
+ 41 0087 8EDB movl %ebx,%ds
42 0089 8ED8 movl %eax,%ds
43
44 008b 661E pushw %ds
175 01a9 66F7F1 div %cx,%ax
176 01ac F7F1 div %ecx,%eax
177 01ae 8EDE mov %si,%ds
- 178 01b0 8EDE movl %si,%ds # warning here
-.*Warning:.*
+ 178 01b0 8EDF movl %edi,%ds
179 01b2 1E pushl %ds
180 01b3 1E push %ds
181 01b4 A0000000 00 mov 0,%al
popl %ds
mov %ds,%eax
movl %ds,%eax
- movl %ds,%ax
+ movl %ds,%ebx
mov %eax,%ds
- movl %ax,%ds
+ movl %ebx,%ds
movl %eax,%ds
pushw %ds
div %cx,%ax
div %ecx,%eax
mov %si,%ds
- movl %si,%ds # warning here
+ movl %edi,%ds
pushl %ds
push %ds
mov 0,%al
.*:98: Error: .*rol.*
.*:99: Error: .*rcl.*
.*:102: Error: .*
+.*:104: Error: .*
+.*:105: Error: .*
+.*:106: Error: .*
GAS LISTING .*
[ ]*[1-9][0-9]*[ ]+
[ ]*[1-9][0-9]*[ ]+\.att_syntax prefix
[ ]*[1-9][0-9]*[ ]+movsd \(%esi\), %ss:\(%edi\), %ss:\(%eax\)
+[ ]*[1-9][0-9]*[ ]+
+[ ]*[1-9][0-9]*[ ]+movl %ds, %ax
+[ ]*[1-9][0-9]*[ ]+movl %ax, %ds
+[ ]*[1-9][0-9]*[ ]+movl %ax, %bx
.att_syntax prefix
movsd (%esi), %ss:(%edi), %ss:(%eax)
+
+ movl %ds, %ax
+ movl %ax, %ds
+ movl %ax, %bx