This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/6004: gcc 3.0.4 always compiles main() with frame (and ebp) even with -fomit-frame-pointer and -ffixed-ebp
- From: jakub at gcc dot gnu dot org
- To: Daniel dot Diaz at univ-paris1 dot fr, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 20 Mar 2002 09:57:57 -0000
- Subject: Re: optimization/6004: gcc 3.0.4 always compiles main() with frame (and ebp) even with -fomit-frame-pointer and -ffixed-ebp
- Reply-to: jakub at gcc dot gnu dot org, Daniel dot Diaz at univ-paris1 dot fr, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: gcc 3.0.4 always compiles main() with frame (and ebp) even with -fomit-frame-pointer and -ffixed-ebp
State-Changed-From-To: open->analyzed
State-Changed-By: jakub
State-Changed-When: Wed Mar 20 01:57:57 2002
State-Changed-Why:
-fomit-frame-pointer documentation sais:
Don't keep the frame pointer in a register for functions that
don't need one, ...
which means the compiler makes no guarantees it will be
actually eliminated.
Particularly main if it aligns the stack pointer.
You might try
gcc -O2 -fomit-frame-pointer -ffixed-ebp -mpreferred-stack-boundary=2 x.c
for the .c file containing main.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6004