This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem on -fomit-frame-pointer
- From: hingwah at gnupilgrims dot org
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 May 2002 02:43:14 +0800
- Subject: problem on -fomit-frame-pointer
Hello,I'm am using a x86 platform and I'm trying to use gcc 2.95.x ,gcc
3.0.x and gcc 3.1 to compile the following code and generate the
assembly of it:
gcc foo.c -S -O2 -fomit-frame-pointer
gcc foo.c -S -O2
foo.c :
#include <stdio.h>
int main(int argc,char *argv[])
{
printf("hello world!\n");
return 0;
}
comparing the output between with and without -fomit-frame-pointer ,
gcc 2.95 work fine : the code to generate the frame pointer e.g
" movl %esp, %ebp " is not shown when given an
-fomit-frame-pointer options when compiling the code
however,there seem to be no effect on gcc 3.0 and gcc 3.1,a frame
pointer is still kept on register ebp with the code " movl %esp,
%ebp",
diff the 2 assembly code with and without -fomit-frame-pointer shown
no difference .
bug?