From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17567 invoked by alias); 8 Dec 2010 19:59:34 -0000 Received: (qmail 17557 invoked by uid 22791); 8 Dec 2010 19:59:33 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50,TW_DN,TW_LB,TW_QL X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Dec 2010 19:59:29 +0000 From: "joakim.tjernlund at transmode dot se" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/46854] New: PowerPC optimization regression X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joakim.tjernlund at transmode dot se 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 Date: Wed, 08 Dec 2010 19:59:00 -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 X-SW-Source: 2010-12/txt/msg00891.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46854 Summary: PowerPC optimization regression Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: joakim.tjernlund@transmode.se I have noticed gcc 4.4.5 often produces less optimzed code than the old 3.4.6. Below is the latest example. I am starting to wonder if I need rebuild gcc 4.4.5 and/or add new options to gcc when I compile. Any insight? Jocke const char *test(int i) { const char *p = "abc\0def\0gef"; for(; i; --i) while(*++p); return p; } /* gcc 4.4.5 -O2 -S .section ".text" .align 2 .globl test .type test, @function test: mr. 0,3 mtctr 0 beq- 0,.L10 lis 3,.LANCHOR0@ha la 3,.LANCHOR0@l(3) .L8: lbzu 0,1(3) cmpwi 7,0,0 bne+ 7,.L8 bdnz .L8 blr .L10: lis 3,.LANCHOR0@ha la 3,.LANCHOR0@l(3) blr .size test, .-test .section .rodata .align 2 .set .LANCHOR0,. + 0 .LC0: .string "abc" .string "def" .string "gef" .ident "GCC: (Gentoo 4.4.5 p1.0, pie-0.4.5) 4.4.5" */ /* gcc 4.4.5 -Os -S .globl test .type test, @function test: mr 9,3 lis 3,.LANCHOR0@ha la 3,.LANCHOR0@l(3) b .L2 .L5: lbzu 0,1(3) cmpwi 7,0,0 bne+ 7,.L5 addi 9,9,-1 .L2: cmpwi 7,9,0 bne+ 7,.L5 blr .size test, .-test .section .rodata .set .LANCHOR0,. + 0 .LC0: .string "abc" .string "def" .string "gef" .ident "GCC: (Gentoo 4.4.5 p1.0, pie-0.4.5) 4.4.5" */ /* gcc 3.4.6 -Os -S and gcc -O2 -S section .rodata .align 2 .LC0: .string "abc" .string "def" .string "gef" .section ".text" .align 2 .globl test .type test, @function test: mr. 0,3 lis 9,.LC0@ha la 3,.LC0@l(9) mtctr 0 beqlr- 0 .L13: lbzu 0,1(3) cmpwi 7,0,0 bne- 7,.L13 bdnz .L13 blr .size test, .-test .section .note.GNU-stack,"",@progbits .ident "GCC: (GNU) 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)" */