public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/39837]  New: [4.3/4.4/4.5 regression] unoptimal code generated
@ 2009-04-21 16:44 alexvod at google dot com
  2009-04-21 16:46 ` [Bug rtl-optimization/39837] " alexvod at google dot com
                   ` (18 more replies)
  0 siblings, 19 replies; 21+ messages in thread
From: alexvod at google dot com @ 2009-04-21 16:44 UTC (permalink / raw)
  To: gcc-bugs

The following code

struct Glob
{
  int f1, f2;
  int x;
};
extern struct Glob g;
int func(int, int*, int);
void test()
{
  int a = 0;
  int* b = &g.x;
  do
    {
      a = *b;
    }
  while (func(a, b, a) != 0);
}
// compilation options: -march=armv5te -fpic -mthumb-interwork -mthumb -Os

is compiled to 36 bytes by GCC 4.2.1 and to 40 bytes bytes by GCC 4.3.1 and
4.4.0.

GCC 4.2.1:
test:
        push    {r4, lr}
        ldr     r3, .L7
        ldr     r2, .L7+4
.LPIC0:
        add     r3, pc
        ldr     r4, [r3, r2]
.L2:
        ldr     r2, [r4, #8]
        mov     r1, r4
        add     r1, r1, #8
        mov     r0, r2
        bl      func
        cmp     r0, #0
        bne     .L2
        @ sp needed for prologue
        pop     {r4, pc}
.L8:
        .align  2
.L7:
        .word   _GLOBAL_OFFSET_TABLE_-(.LPIC0+4)
        .word   g(GOT)

GCC 4.4.0:
test:
        push    {r4, r5, r6, lr}
        ldr     r3, .L6
        ldr     r2, .L6+4
.LPIC0:
        add     r3, pc
        ldr     r4, [r3, r2]
        mov     r5, r4
        add     r5, r5, #8
.L2:
        ldr     r2, [r4, #8]
        mov     r1, r5
        mov     r0, r2
        bl      func
        cmp     r0, #0
        bne     .L2
        @ sp needed for prologue
        pop     {r4, r5, r6, pc}
.L7:
        .align  2
.L6:
        .word   _GLOBAL_OFFSET_TABLE_-(.LPIC0+4)
        .word   g(GOT)

Bisection shows that this was changed by CL
http://gcc.gnu.org/viewcvs?view=rev&revision=123919

When running with -da -ftree-dump-all options, I see that first changed dump is
regr.c.139r.loop2_invariant.


-- 
           Summary: [4.3/4.4/4.5 regression] unoptimal code generated
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: alexvod at google dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: arm-eabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39837


^ permalink raw reply	[flat|nested] 21+ messages in thread
[parent not found: <bug-39837-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-06-27 14:57 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-21 16:44 [Bug rtl-optimization/39837] New: [4.3/4.4/4.5 regression] unoptimal code generated alexvod at google dot com
2009-04-21 16:46 ` [Bug rtl-optimization/39837] " alexvod at google dot com
2009-04-21 16:47 ` alexvod at google dot com
2009-04-21 16:49 ` pinskia at gcc dot gnu dot org
2009-04-22 13:37 ` rguenth at gcc dot gnu dot org
2009-04-23 16:40 ` alexvod at google dot com
2009-05-20 14:17 ` ramana at gcc dot gnu dot org
2009-08-04 12:49 ` [Bug rtl-optimization/39837] [4.3/4.4/4.5 regression] extra spills due to RTL LICM rguenth at gcc dot gnu dot org
2010-01-02  0:42 ` steven at gcc dot gnu dot org
2010-01-29 23:11 ` steven at gcc dot gnu dot org
2010-01-30  9:47 ` rakdver at kam dot mff dot cuni dot cz
2010-03-02 19:59 ` pinskia at gcc dot gnu dot org
2010-03-02 20:10 ` pinskia at gcc dot gnu dot org
2010-07-10 21:07 ` sandra at codesourcery dot com
2010-07-11  7:51 ` bonzini at gnu dot org
2010-07-11 11:40 ` steven at gcc dot gnu dot org
2010-07-11 17:47 ` sandra at codesourcery dot com
2010-07-11 22:48 ` steven at gcc dot gnu dot org
2010-07-11 22:55 ` steven at gcc dot gnu dot org
2010-07-13 17:13 ` sandra at codesourcery dot com
     [not found] <bug-39837-4@http.gcc.gnu.org/bugzilla/>
2011-06-27 14:57 ` rguenth at gcc dot gnu.org

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).