Bug 27419 - x86-64: regression: gas accepts invalid code (movdir64b / enqcmd)
Summary: x86-64: regression: gas accepts invalid code (movdir64b / enqcmd)
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.36
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-15 10:01 UTC by Jan Beulich
Modified: 2022-06-22 06:31 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beulich 2021-02-15 10:01:28 UTC
As a supposed fix (really at best: workaround, bug gas/26685) for a gcc shortcoming, symbol(%rip) style operands got special cased when present for these insns. This leads to gas accepting e.g.

	movdir64b foo(%rip),%ecx

despite being invalid. The two operands are really ambiguous, and hence shouldn't be accepted silently: Besides the gcc issue (which ought to be addressed there instead of worked around in gas), the programmer (of plain assembly sources or inline asm()) may have meant either

	movdir64b foo(%eip),%ecx

or

	movdir64b foo(%rip),%rcx

To make the workaround remotely acceptable, it should imo at least be restricted to the --x32 case. Even there it would better be warned about, perhaps unless -q was specified.
Comment 1 Jan Beulich 2021-03-25 07:24:03 UTC
As of commit 829f3fe1f023 breakage is at least limited to x32 mode now.