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 rtl-optimization/32849] New: Unnecessary %esp inc/decrements in trivial code


Compiling this code:

int f();
void g();
void t() { if (f()) g(); }

with gcc -Os -fomit-frame-pointer -S t.c produces:

        .file   "t.c"
        .text
.globl t
        .type   t, @function
t:
        subl    $12, %esp
        call    f
        testl   %eax, %eax
        je      .L4
        addl    $12, %esp
        jmp     g
.L4:
        addl    $12, %esp
        ret
        .size   t, .-t
        .ident  "GCC: (GNU) 4.2.1"
        .section        .note.GNU-stack,"",@progbits

subl/addl $12, %esp seem to be completely pointless to me here.


-- 
           Summary: Unnecessary %esp inc/decrements in trivial code
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vda dot linux at googlemail dot com
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32849


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