This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14312] New: [tree-ssa regression] tailcalls not being generated when functions contain pointers
- From: "rearnsha at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2004 01:04:45 -0000
- Subject: [Bug optimization/14312] New: [tree-ssa regression] tailcalls not being generated when functions contain pointers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The attached function no-longer generates tail calls in tree-ssa. This is a
regression from 3.5.0 (the problem seems to be some intermediate variables that
are created by earlier passes and which are marked non-static, addressable).
Compile the attached code with
arm-elf-gcc -O2 -S test.c
void bar(int i);
void baz(int *);
void foo(int *x) { if (*x < 0) { baz (x); return; } bar(*x);
}
observe that the resulting code is
foo:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
ldr r3, [r0, #0]
cmp r3, #0
sub fp, ip, #4
blt .L5
mov r0, r3
bl bar
ldmfd sp, {fp, sp, pc}
.L5:
bl baz
ldmfd sp, {fp, sp, pc}
when it should be
ldr r3, [r0, #0]
cmp r3, #0
@ lr needed for prologue
blt .L4
mov r0, r3
b bar
.L4:
b baz
--
Summary: [tree-ssa regression] tailcalls not being generated when
functions contain pointers
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rearnsha at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14312