https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60641

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |rtl-optimization

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Alex Kruppa from comment #2)
> Dump of assembler code for function bar:
>    0x0000000000000020 <+0>:   movzwl %si,%eax
>    0x0000000000000023 <+3>:   movzwl %si,%esi
>    0x0000000000000026 <+6>:   mov    %esi,(%rdi,%rax,4)
>    0x0000000000000029 <+9>:   retq

bar:
        movzwl  %si, %eax       # 8     zero_extendhidi2/1
        movzwl  %si, %esi       # 9     *zero_extendhisi2/1
        movl    %esi, (%rdi,%rax,4)     # 10    *movsi_internal/2
        ret     # 16    simple_return_internal

These two movzwl insns are actually different instructions. The first extends
from HImode to DImode, the other from HImode to SImode.

Perhaps copy propagator or REE pass can be enhanced to propagate zero-extended
value from a wider mode to a narrow mode access.

Reply via email to