This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/42590] unnecessary stack frame set up
- From: "jamborm at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2010 18:02:31 -0000
- Subject: [Bug middle-end/42590] unnecessary stack frame set up
- References: <bug-42590-7834@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jamborm at gcc dot gnu dot org 2010-01-25 18:02 -------
Since PR 42585 is fixed, the optimized dump (at -O2) is
<bb 2>:
_T2$curr_12 = sptr_1(D)->curr;
D.1966_7 = _T2$curr_12 + -1;
sptr_1(D)->curr = D.1966_7;
return 0;
}
The generated assembly is:
Cyc_string_ungetc:
pushl %ebp
movl %esp, %ebp
movl 12(%ebp), %eax
subl $1, (%eax)
xorl %eax, %eax
popl %ebp
ret
With -O2 -fomit-frame-pointer it is:
Cyc_string_ungetc:
movl 8(%esp), %eax
subl $1, (%eax)
xorl %eax, %eax
ret
(Which is weird because the manual says that -fomit-frame-pointer is
enabled at -O2 by default - maybe this is the actual bug here now?)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42590