This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/30288] New: tail call with additional arguments


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]