bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/25438] x86 MOVZ* anomalies for unusual/wrong operand combinatio


From: cvs-commit at gcc dot gnu.org
Subject: [Bug gas/25438] x86 MOVZ* anomalies for unusual/wrong operand combinations
Date: Wed, 22 Jan 2020 18:20:06 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25438

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by H.J. Lu <address@hidden>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=be4c5e58bdc839898739e0332aee84abf6e5299a

commit be4c5e58bdc839898739e0332aee84abf6e5299a
Author: H.J. Lu <address@hidden>
Date:   Wed Jan 22 09:24:14 2020 -0800

    x86: Always disallow double word suffix with word general register

    In 64-bit mode, double word suffix in mnemonic with word general register
    is disallowed.  Otherwise, assembler gives a warning:

    $ cat /tmp/x.s
        movl    %ax, %bx
        movl    %ds, %ax
        movl    %ax, %cs
    $ gcc -c /tmp/x.s
    /tmp/x.s: Assembler messages:
    /tmp/x.s:1: Error: incorrect register `%bx' used with `l' suffix
    /tmp/x.s:2: Error: incorrect register `%ax' used with `l' suffix
    /tmp/x.s:3: Error: incorrect register `%ax' used with `l' suffix
    $ gcc -c /tmp/x.s -m32
    /tmp/x.s: Assembler messages:
    /tmp/x.s: Assembler messages:
    /tmp/x.s:1: Warning: using `%ebx' instead of `%bx' due to `l' suffix
    /tmp/x.s:1: Warning: using `%eax' instead of `%ax' due to `l' suffix
    /tmp/x.s:2: Warning: using `%eax' instead of `%ax' due to `l' suffix
    /tmp/x.s:3: Warning: using `%eax' instead of `%ax' due to `l' suffix

    This patch makes it a hard error in all modes.  Now we get:

    $ gcc -c /tmp/x.s -m32
    /tmp/x.s: Assembler messages:
    /tmp/x.s:1: Error: incorrect register `%bx' used with `l' suffix
    /tmp/x.s:2: Error: incorrect register `%ax' used with `l' suffix
    /tmp/x.s:3: Error: incorrect register `%ax' used with `l' suffix

        PR gas/25438
        * config/tc-i386.c (check_long_reg): Always disallow double word
        suffix in mnemonic with word general register.
        * testsuite/gas/i386/general.s: Replace word general register
        with double word general register for movl.
        * testsuite/gas/i386/inval.s: Add tests for movl with word general
        register.
        * testsuite/gas/i386/general.l: Updated.
        * testsuite/gas/i386/inval.l: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]