This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/30288] New: tail call with additional arguments
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Dec 2006 23:08:31 -0000
- Subject: [Bug tree-optimization/30288] New: tail call with additional arguments
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This tail call could be optimized: Just
push the final 0, then jump.
$ cat tail.c
int foo (int, int);
int bar (int i)
{
return foo (i, 0);
}
$ gcc -fomit-frame-pointer -S -O3 tail.c
$ cat tail.s
.file "tail.c"
.text
.p2align 4,,15
.globl bar
.type bar, @function
bar:
subl $12, %esp
movl 16(%esp), %eax
movl $0, 4(%esp)
movl %eax, (%esp)
call foo
addl $12, %esp
ret
.size bar, .-bar
.ident "GCC: (GNU) 4.3.0 20061211 (experimental)"
.section .note.GNU-stack,"",@progbits
--
Summary: tail call with additional arguments
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30288