From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24472 invoked by alias); 16 Mar 2013 11:35:17 -0000 Received: (qmail 23648 invoked by uid 48); 16 Mar 2013 11:34:53 -0000 From: "neleai at seznam dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/56631] New: duplicated sse code in switch Date: Sat, 16 Mar 2013 11:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: neleai at seznam dot cz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-03/txt/msg01167.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56631 Bug #: 56631 Summary: duplicated sse code in switch Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassigned@gcc.gnu.org ReportedBy: neleai@seznam.cz Consider attached testcase. When compiled with -Os,-O2,-O3 it duplicates zeroing xmm1 register across all branches. Moving zeroing before braches will save space. Relevant assembly at -Os is jmp *.L19(,%rax,8) .section .rodata .align 8 .align 4 .L19: .quad .L21 .quad .L4 .quad .L5 snip .L21: xorps %xmm1, %xmm1 .L38: movaps %xmm0, %xmm2 pcmpeqb %xmm1, %xmm2 pmovmskb %xmm2, %eax testl %eax, %eax jne .L1 .L2: movdqu %xmm0, (%rdi) addq $64, %rdi movups 64(%rsi), %xmm0 addq $64, %rsi jmp .L38 .L4: xorps %xmm1, %xmm1 incq %rdi .L23: snip .L5: xorps %xmm1, %xmm1 addq $2, %rdi