problem on -fomit-frame-pointer
hingwah@gnupilgrims.org
hingwah@gnupilgrims.org
Sat May 18 11:43:00 GMT 2002
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?
More information about the Gcc-bugs
mailing list