This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/32849] New: Unnecessary %esp inc/decrements in trivial code
- From: "vda dot linux at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2007 23:30:33 -0000
- Subject: [Bug rtl-optimization/32849] New: Unnecessary %esp inc/decrements in trivial code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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