From 77c59789070949a1cfbd19578c6935ccd57869c2 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 8 Jun 2021 14:55:56 +0200 Subject: 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gas/ChangeLog') diff --git a/gas/ChangeLog b/gas/ChangeLog index 5926fff..e2084f8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,16 @@ 2021-06-08 Jan Beulich + * config/tc-i386.c (optimize_disp): Write back updated value. + * testsuite/gas/i386/lea16.s, testsuite/gas/i386/lea64.s: New + cases. + * testsuite/gas/i386/lea16-optimize.d, + testsuite/gas/i386/lea64.d, testsuite/gas/i386/lea64-optimize.d: + Adjust expectations. + * testsuite/gas/i386/lea16.d: New. + * testsuite/gas/i386/i386.exp: Run new test. + +2021-06-08 Jan Beulich + * config/tc-i386.c (optimize_disp): Drop redundant masking. Re-order. -- cgit v1.1