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: jbeulich at suse dot com
Subject: [Bug gas/25438] x86 MOVZ* anomalies for unusual/wrong operand combinations
Date: Wed, 22 Jan 2020 14:45:57 +0000

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

--- Comment #2 from Jan Beulich <jbeulich at suse dot com> ---
(In reply to H.J. Lu from comment #1)
> movz* with incorrect operands should be rejected, not silently changed
> to something else:
> 
> [hjl@gnu-snb-1 tmp]$ cat x.s
> movzbw        %al, %ecx
> movzbw        %al, %rcx
> movzbl        %al, %cx
> movzbl        %al, %rcx
> movzbq        %al, %cx
> movzbq        %al, %ecx
> [hjl@gnu-snb-1 tmp]$ gcc -c x.s
> [hjl@gnu-snb-1 tmp]$ objdump -dw x.o
> 
> x.o:     file format elf64-x86-64
> 
> 
> Disassembly of section .text:
> 
> 0000000000000000 <.text>:
>    0: 0f b6 c8                movzbl %al,%ecx
>    3: 48 0f b6 c8             movzbq %al,%rcx
>    7: 66 0f b6 c8             movzbw %al,%cx
>    b: 48 0f b6 c8             movzbq %al,%rcx
>    f: 66 0f b6 c8             movzbw %al,%cx
>   13: 0f b6 c8                movzbl %al,%ecx
> [hjl@gnu-snb-1 tmp]$

Indeed that's what the patch is doing, for 64-bit code.

For 32-bit (and 16-bit) code though this isn't the way to go, as long as e.g.

        movl    %al, %al
        movl    %ax, %ax

produce an error on the first line, but only two warnings on the second one.
Behavior for MOVZ* simply gets brought in line with this by the proposed patch.

-- 
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]