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