public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/46854] New: PowerPC optimization regression
@ 2010-12-08 19:59 joakim.tjernlund at transmode dot se
  2010-12-09  9:11 ` [Bug rtl-optimization/46854] " joakim.tjernlund at transmode dot se
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: joakim.tjernlund at transmode dot se @ 2010-12-08 19:59 UTC (permalink / raw)
  To: gcc-bugs

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)"
*/


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-09 18:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-08 19:59 [Bug rtl-optimization/46854] New: PowerPC optimization regression joakim.tjernlund at transmode dot se
2010-12-09  9:11 ` [Bug rtl-optimization/46854] " joakim.tjernlund at transmode dot se
2010-12-09 17:57 ` meissner at gcc dot gnu.org
2010-12-09 18:22 ` joakim.tjernlund at transmode dot se
2010-12-09 18:24 ` joakim.tjernlund at transmode dot se

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).