This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug with -fomit-frame-pointer in GCC3.2 and GCC3.3
- From: serrano at redrock dot inria dot fr (Manuel Serrano)
- To: gnu-gcc-bug at cis dot ohio-state dot edu
- Date: 23 Jun 2003 17:07:44 GMT
- Subject: Bug with -fomit-frame-pointer in GCC3.2 and GCC3.3
- Newsgroups: gnu.gcc.bug
- Organization: I.N.R.I.A. Unite de Recherche de Sophia Antipolis (France)
I have found a problem with GCC3.2 and GCC3.3 when -fomit-frame-pointer
and -O2 are both used. The bug seems to be concerning the registers allocation
that seems erroneous. The problem does not exist with GCC2.95. It goes away
if either -fomit-frame-pointer or -O2 are disabled.
*** Operating system:
=====================
$ uname -a
Linux owens.inria.fr 2.4.21 #1 Tue Jun 17 16:26:21 CEST 2003 i686 GNU/Linux
*** GCC version:
================
gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.3 (Debian)
*** Source code:
================
int hux(int x){
if(x){
foo( 4 );
return x;
}
failure_then_exit(x);
}
*** GCC Command line:
=====================
gcc -O2 -fomit-frame-pointer foo.c
*** Preprocessed source file:
=============================
$ gcc -fomit-frame-pointer foo.c -S -O2 -save-temps
$ cat foo.i
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"
int hux(int x)
{
if(x)
{
foo( 4 );
return x;
}
failure_then_exit(x);
}
*** Assembly file (that I known you don't want bug that shows the bug):
=======================================================================
$ cat foo.s
.file "foo.c"
.text
.p2align 2,,3
.globl hux
.type hux, @function
hux:
pushl %ebx
subl $8, %esp
movl 16(%esp), %ebx
testl %ebx, %ebx
je .L2
subl $12, %esp
pushl $4
call foo # <-- HERE, THE REGISTER EAX IS NOT
.L3: # RELOADED !!!
addl $24, %esp
popl %ebx
ret
.p2align 2,,3
.L2:
subl $12, %esp
pushl $0
call failure_then_exit
jmp .L3
.size hux, .-hux
.ident "GCC: (GNU) 3.3 (Debian)"
--
Manuel Serrano