From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118235 invoked by alias); 5 Aug 2015 11:07:47 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 118171 invoked by uid 48); 5 Aug 2015 11:07:42 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67124] [6 Regression] wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu Date: Wed, 05 Aug 2015 11:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_gcctarget component Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg00297.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67124 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86_64-*-* Component|rtl-optimization |target --- Comment #2 from Richard Biener --- Hmm, looks like a target issue. We expand from c = a[1]; c$2_10 = MEM[(struct S1[2] *)&a + 18B]; b.0_4 = b; MEM[(struct S1 *)&c + 2B] = c$2_10; MEM[(struct S1 *)&c + 4B] = 0; *b.0_4 = c; if (c$2_10 != 0) .. _6 = a[0].f3; if (_6 != 1) ... and get movzbl a+18(%rip), %eax movdqa a+16(%rip), %xmm0 movq %xmm0, %rdx movq %rax, %rcx salq $16, %rax andq $-16711681, %rdx orq %rax, %rdx xorl %eax, %eax testb %cl, %cl movq %rdx, 8(%rsp) movq 8(%rsp), %xmm0 pinsrw $2, %eax, %xmm0 movq b(%rip), %rax movups %xmm0, (%rax) <--- jne .L2 .L3: jmp .L3 .p2align 4,,10 .p2align 3 .L2: cmpl $1, a+8(%rip) jne .L7 but <--- stores the wrong value here. -mno-sse2 fixes the testcase.