diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-01-22 09:24:14 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-01-22 09:24:14 -0800 |
commit | be4c5e58bdc839898739e0332aee84abf6e5299a (patch) | |
tree | 5b2fa8999c65f96def40ddd14b6560045d83f8b8 /gas/ChangeLog | |
parent | 6a462ad49ec13bec4659f2a8fb2301cac9742da9 (diff) | |
download | gdb-be4c5e58bdc839898739e0332aee84abf6e5299a.zip gdb-be4c5e58bdc839898739e0332aee84abf6e5299a.tar.gz gdb-be4c5e58bdc839898739e0332aee84abf6e5299a.tar.bz2 |
x86: Always disallow double word suffix with word general register
In 64-bit mode, double word suffix in mnemonic with word general register
is disallowed. Otherwise, assembler gives a warning:
$ cat /tmp/x.s
movl %ax, %bx
movl %ds, %ax
movl %ax, %cs
$ gcc -c /tmp/x.s
/tmp/x.s: Assembler messages:
/tmp/x.s:1: Error: incorrect register `%bx' used with `l' suffix
/tmp/x.s:2: Error: incorrect register `%ax' used with `l' suffix
/tmp/x.s:3: Error: incorrect register `%ax' used with `l' suffix
$ gcc -c /tmp/x.s -m32
/tmp/x.s: Assembler messages:
/tmp/x.s: Assembler messages:
/tmp/x.s:1: Warning: using `%ebx' instead of `%bx' due to `l' suffix
/tmp/x.s:1: Warning: using `%eax' instead of `%ax' due to `l' suffix
/tmp/x.s:2: Warning: using `%eax' instead of `%ax' due to `l' suffix
/tmp/x.s:3: Warning: using `%eax' instead of `%ax' due to `l' suffix
This patch makes it a hard error in all modes. Now we get:
$ gcc -c /tmp/x.s -m32
/tmp/x.s: Assembler messages:
/tmp/x.s:1: Error: incorrect register `%bx' used with `l' suffix
/tmp/x.s:2: Error: incorrect register `%ax' used with `l' suffix
/tmp/x.s:3: Error: incorrect register `%ax' used with `l' suffix
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.
Diffstat (limited to 'gas/ChangeLog')
-rw-r--r-- | gas/ChangeLog | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 2d247a1..8a18aa7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +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 |