This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH v2 1/4] x86: extend LEA's segment override warning
On Fri, Feb 14, 2020 at 3:43 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> For one both possible forms should be warned about. And then, to guard
> against future surprises, qualify the original opcode check by excluding
> VEX/EVEX-like templates.
>
> gas/
> 2020-02-XX Jan Beulich <jbeulich@suse.com>
>
> * config/tc-i386.c (process_operands): Also check insn prefix
> for ineffectual segment override warning. Don't cover possible
> VEX/EVEX encoded insns there.
> * testsuite/gas/i386/lea.s, testsuite/gas/i386/lea.d,
> testsuite/gas/i386/lea.e: New.
> * testsuite/gas/i386/i386.exp: Run new test.
> ---
> v2: Move controversial MPX part to separate patch.
>
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -7194,9 +7194,10 @@ duplicate:
> }
> }
>
> - if (i.tm.base_opcode == 0x8d /* lea */
> - && i.seg[0]
> - && !quiet_warnings)
> + if ((i.seg[0] || i.prefix[SEG_PREFIX])
Does your testcase verify that we need to check both
i.seg[0] and i.prefix[SEG_PREFIX]? If yes, patch is OK.
Thanks.
> + && !quiet_warnings
> + && i.tm.base_opcode == 0x8d /* lea */
> + && !is_any_vex_encoding(&i.tm))
> as_warn (_("segment override on `%s' is ineffectual"), i.tm.name);
>
--
H.J.