This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/86763] [8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|x86_64-                     |x86_64-*-*
           Priority|P3                          |P2
                 CC|                            |uros at gcc dot gnu.org
   Target Milestone|---                         |8.3

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
RTL expansion shows different alignment of some stack vars, -O1
-fstrict-aliasing is also broken.  Assembler difference -O1 vs. -O2 is

 main:
@@ -45,24 +48,24 @@
        subq    $488, %rsp
        .cfi_def_cfa_offset 496
        call    _Z8init_msgv
-       movq    %rax, (%rsp)
-       movq    %rdx, 8(%rsp)
-       leaq    240(%rsp), %rdi
-       movq    %rsp, %rsi
+       movq    %rsp, %rdi
        movl    $29, %ecx
+       leaq    240(%rsp), %rsi
+       movq    %rax, 240(%rsp)
+       cmpq    $1001, 8(%rsp)
+       movq    %rdx, 248(%rsp)
        rep movsq
        movl    (%rsi), %eax
        movl    %eax, (%rdi)
        movzbl  4(%rsi), %eax
        movb    %al, 4(%rdi)
-       cmpq    $1001, 248(%rsp)
-       jne     .L7
-       movl    $0, %eax
+       jne     .L8
+       xorl    %eax, %eax
        addq    $488, %rsp
        .cfi_remember_state
        .cfi_def_cfa_offset 8
        ret
-.L7:
+.L8:
        .cfi_restore_state


see how the compare is moved very far away from the branch possibly across
flag clobbering insns (rep movsq?).  Target sounds good.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]