This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/46556] New: Code size regression in struct access


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

           Summary: Code size regression in struct access
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: amodra@gmail.com


/* -Os -mcpu=405 -msoft-float */
struct x
{
  unsigned int a[16];
  unsigned int b[16];
  unsigned int c[16];
};

void
f (struct x *p, unsigned int n)
{
  extern void foo (int, int, int);
  int a = p->a[n];
  int c = p->c[n];
  int b = p->b[n];

  foo (a, c, b);
}

results in

f:
        stwu 1,-16(1)
        mflr 0
        addi 11,4,32
        stw 0,20(1)
        addi 0,4,16
        mr 9,3
        slwi 10,4,2
        slwi 0,0,2
        slwi 11,11,2
        lwzx 5,9,0
        lwzx 3,3,10
        lwzx 4,9,11
        bl foo
        lwz 0,20(1)
        addi 1,1,16
        mtlr 0
        blr

a four instruction code size regression against gcc-4.2, which produces

f:
        stwu 1,-16(1)
        mflr 0
        slwi 4,4,2
        stw 0,20(1)
        add 9,4,3
        lwz 5,64(9)
        lwzx 3,4,3
        lwz 4,128(9)
        bl foo
        lwz 0,20(1)
        addi 1,1,16
        mtlr 0
        blr

gcc regressed on this testcase at 4.3.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]