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: [email protected]
ReportedBy: [email protected]
/* -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