This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41749] New: non-needed instructions are not removed (not optimized)
- From: "socketpair at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2009 07:10:21 -0000
- Subject: [Bug c/41749] New: non-needed instructions are not removed (not optimized)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int main (void) { return 1; }
Ubuntu Jaunty.
gcc --save-temps -fno-stack-protector -fomit-frame-pointer -Os ./cpuid.c
generates thgis:
--------------
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
movl $1, %eax
pushl %ecx
popl %ecx
leal -4(%ecx), %esp
ret
--------------------------
why i get this:
pushl %ecx
popl %ecx
and other non-needed instructions (for another example)
pushl %ebp
andl $1, %eax
movl %esp, %ebp
pushl %ecx
popl %ecx
popl %ebp
These instructions are not optimized not in -O3, nor in -Os
--
Summary: non-needed instructions are not removed (not optimized)
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: socketpair at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41749