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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.8.5, 5.1.0
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2016-07-14
          Component|c++                         |target
     Ever confirmed|0                           |1
            Summary|memmove works wrong         |[4.9 Regression] memmove
                   |                            |works wrong
   Target Milestone|---                         |4.9.4
      Known to fail|                            |4.9.3

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can reproduce it with GCC 4.9 but not with GCC 4.8 or GCC 5.  The bug happens
even at -O0 for me.  Branch head fails as well.  memmove is inline-expanded to

        leaq    -48(%rbp), %rax
        movq    %rax, %rdi
        call    puts
        leaq    -48(%rbp), %rax
        addq    $20, %rax
        leaq    -48(%rbp), %rdx
        addq    $15, %rdx
        movq    (%rdx), %rcx
        movq    %rcx, (%rax)
        movzwl  8(%rdx), %ecx
        movw    %cx, 8(%rax)
        movzbl  10(%rdx), %edx
        movb    %dl, 10(%rax)
        leaq    -48(%rbp), %rax
        movq    %rax, %rdi
        call    puts

GCC 5 no longer inline-expands memmove here, not even with optimization.

Reply via email to