[PATCH v2 4/4] x86: extend LEA's segment override warning to applicable MPX insns
Jan Beulich
jbeulich@suse.com
Fri Feb 14 12:08:00 GMT 2020
On 14.02.2020 13:04, H.J. Lu wrote:
> On Fri, Feb 14, 2020 at 3:44 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Besides LEA there are a couple of MPX insns behaving LEA-like, which
>> should be warned about in the same way.
>>
>> gas/
>> 2020-02-XX Jan Beulich <jbeulich@suse.com>
>>
>> * config/tc-i386.c (process_operands): Also check insn prefix
>> for ineffectual segment override warning. Also cover BNDC* and
>> BNDMK there. 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.
>>
>> --- a/gas/config/tc-i386.c
>> +++ b/gas/config/tc-i386.c
>> @@ -7195,7 +7195,8 @@ duplicate:
>> }
>>
>> if ((i.seg[0] || i.prefix[SEG_PREFIX])
>> - && i.tm.base_opcode == 0x8d /* lea */
>> + && (i.tm.base_opcode == 0x8d /* lea */
>> + || ((i.tm.base_opcode | 0x010001) == 0xf30f1b) /* bnd{c[lnu],mk} */)
>> && !is_any_vex_encoding(&i.tm))
>
> There is no need for it. Since MPX has been deprecated, I doubt anyone
> will update MPX assembly codes even if they trigger this new warning.
There's perhaps as much doubt about this as there is on there being
people actually using segment overrides with LEA and alike. If it
was code I'm the maintainer for, I'd be glad if such issues were
pointed out to me. But anyway - you've made your position clear
before, and I've added this as the last patch here just for
completeness (as I'll want to have this in my local trees down the
road anyway).
Jan
More information about the Binutils
mailing list