]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86-64: avoid bogus warnings with 32-bit addressing
authorJan Beulich <jbeulich@suse.com>
Tue, 8 Jun 2021 12:55:56 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 8 Jun 2021 12:55:56 +0000 (14:55 +0200)
commit77c59789070949a1cfbd19578c6935ccd57869c2
tree283571b167bf04fce848bd7e472f0ceea993f3ed
parentf185acddfa246009e72e5bea95cd457ccc0cc763
x86-64: avoid bogus warnings with 32-bit addressing

With optimize_disp() adjusting i.types[].bitfield.disp after adjusting
the value to be used as displacement, it better also stores the updated
value, to avoid subsequent "... shortened to ..." warnings. Note how
optimize_imm() already does so.

The -0xffffffff tests being added expose a separate issue: The encoding
chosen should be 1 for ModR/M.mod, not 2. This will want to be taken
care of, but not right here.

This at the same time addresses a similar warning and demonstrates a
similar encoding issue with 16-bit addressing. Since it was omitted
when introducing the lea16-optimize test, add a plain lea16 one to also
cover this.
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/lea16-optimize.d
gas/testsuite/gas/i386/lea16.d [new file with mode: 0644]
gas/testsuite/gas/i386/lea16.s
gas/testsuite/gas/i386/lea64-optimize.d
gas/testsuite/gas/i386/lea64.d
gas/testsuite/gas/i386/lea64.s