public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/39871]  New: [4.3/4.4/4.5 regression] CSE doesn't work
@ 2009-04-23 16:16 alexvod at google dot com
  2009-04-24  9:14 ` [Bug rtl-optimization/39871] " rguenth at gcc dot gnu dot org
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: alexvod at google dot com @ 2009-04-23 16:16 UTC (permalink / raw)
  To: gcc-bugs

The following code:

struct A
{
  int version;
  const char *name;
  void* group;
};
struct B
{
  const char *name;
  int ok;
};
void func(struct A*, int);

void test(struct B *p)
{
  struct A a;
  a.name = p->name;
  func(&a, p->ok);
}
options: --march=armv5te -mthumb -mthumb-interwork -fpic -Os

is compiled to 18 bytes by GCC 4.2.1 and to 20 bytes by GCC 4.3 (and later,
including 4.4).

Bisection shows that it is changed by
http://gcc.gnu.org/viewcvs?view=rev&revision=118475:

GCC rev118474:
        push    {lr}
        sub     sp, sp, #20
        ldr     r3, [r0]
        ldr     r1, [r0, #4]
        add     r0, sp, #4
        str     r3, [sp, #8]
        bl      func
        add     sp, sp, #20
        @ sp needed for prologue
        pop     {pc}

GCC rev118475:

test:
        push    {lr}
        sub     sp, sp, #20
        add     r2, sp, #4 // this could be stored directly in r0
        ldr     r3, [r0]
        ldr     r1, [r0, #4]
        str     r3, [r2, #4]
        mov     r0, r2  // this mov can be eliminated
        bl      func
        add     sp, sp, #20
        @ sp needed for prologue
        pop     {pc}

A lot of CSE pass code was removed in this change, so there is no surprise that
CSE started to work worse after it.


-- 
           Summary: [4.3/4.4/4.5 regression] CSE doesn't work
           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=39871


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

end of thread, other threads:[~2010-06-17 21:55 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 16:16 [Bug rtl-optimization/39871] New: [4.3/4.4/4.5 regression] CSE doesn't work alexvod at google dot com
2009-04-24  9:14 ` [Bug rtl-optimization/39871] " rguenth at gcc dot gnu dot org
2009-05-05 15:41 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5 regression] Code size increase on ARM due to inferior CSE mmitchel at gcc dot gnu dot org
2009-05-06 15:07 ` bonzini at gnu dot org
2009-05-20 14:17 ` ramana at gcc dot gnu dot org
2009-06-14 10:24 ` mikpe at it dot uu dot se
2009-06-14 14:06 ` mikpe at it dot uu dot se
2009-08-04 12:49 ` rguenth at gcc dot gnu dot org
2010-01-02  0:21 ` steven at gcc dot gnu dot org
2010-01-02 10:29 ` bonzini at gnu dot org
2010-01-02 10:31 ` bonzini at gnu dot org
2010-02-08 11:15 ` steven at gcc dot gnu dot org
2010-02-08 11:54 ` rguenth at gcc dot gnu dot org
2010-02-10 12:18 ` jingyu at google dot com
2010-02-10 13:01 ` steven at gcc dot gnu dot org
2010-02-10 13:04 ` steven at gcc dot gnu dot org
2010-02-10 16:28 ` steven at gcc dot gnu dot org
2010-02-10 17:23 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5 regression] Code size increase on ARM due to poor register allocation steven at gcc dot gnu dot org
2010-02-10 17:50 ` steven at gcc dot gnu dot org
2010-02-10 19:25 ` steven at gcc dot gnu dot org
2010-02-10 22:50 ` steven at gcc dot gnu dot org
2010-02-10 23:11 ` bonzini at gnu dot org
2010-02-10 23:45 ` ramana at gcc dot gnu dot org
2010-02-10 23:47 ` steven at gcc dot gnu dot org
2010-02-10 23:53 ` steven at gcc dot gnu dot org
2010-03-18  8:29 ` steven at gcc dot gnu dot org
2010-03-18  8:31 ` steven at gcc dot gnu dot org
2010-04-06 11:38 ` rguenth at gcc dot gnu dot org
2010-06-04 12:44 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5/4.6 " bernds at gcc dot gnu dot org
2010-06-17 21:52 ` bernds at gcc dot gnu dot org
2010-06-17 21:55 ` bernds at gcc dot gnu dot 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).