This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/39837] New: [4.3/4.4/4.5 regression] unoptimal code generated
- From: "alexvod at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Apr 2009 16:44:01 -0000
- Subject: [Bug rtl-optimization/39837] New: [4.3/4.4/4.5 regression] unoptimal code generated
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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