From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14067 invoked by alias); 21 Jul 2007 23:30:41 -0000 Received: (qmail 14055 invoked by uid 48); 21 Jul 2007 23:30:33 -0000 Date: Sat, 21 Jul 2007 23:30:00 -0000 Subject: [Bug rtl-optimization/32849] New: Unnecessary %esp inc/decrements in trivial code X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "vda dot linux at googlemail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02212.txt.bz2 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