This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
i386, latest snapshot codesourcery, use of uninited reg
- To: gcc-bugs at gcc dot gnu dot org
- Subject: i386, latest snapshot codesourcery, use of uninited reg
- From: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- Date: Fri, 14 Apr 2000 16:25:19 +0200 (CEST)
Hello,
Here is a simple soft:
void fct (void)
{
static unsigned stub_orig;
stub_orig = *(unsigned*)__builtin_frame_address(0);
}
With http://www.codesourcery.com/gcc-compile.html
and option -Os it is OK:
---------------------------
.file "@11584.1"
.version "01.01"
gcc2_compiled.:
.local stub_orig.0
.comm stub_orig.0,4,4
.text
.align 4
.globl fct
.type fct,@function
fct:
pushl %ebp
movl %esp, %ebp
movl 0(%ebp), %eax
movl %eax, stub_orig.0
popl %ebp
ret
.Lfe1:
.size fct,.Lfe1-fct
.ident "GCC: (GNU) 2.96 20000414 (experimental)"
---------------------------
But if I add -fomit-frame-pointer, I get:
---------------------------
.file "@11627.1"
.version "01.01"
gcc2_compiled.:
.local stub_orig.0
.comm stub_orig.0,4,4
.text
.align 4
.globl fct
.type fct,@function
fct:
movl 0(%ebp), %eax !!!!!!!!!!!!!!!
pushl %ebp
movl %eax, stub_orig.0
popl %ebp
ret
.Lfe1:
.size fct,.Lfe1-fct
.ident "GCC: (GNU) 2.96 20000414(experimental)"
---------------------------
i.e. %ebp is not initialised before been referenced,
the line "movl 0(%ebp), %eax" should be "movl (%esp), %eax".
Was working with GCC-2.95.2, but not with gcc version 2.96 20000327
Have a nice day,
Etienne.
___________________________________________________________
Do You Yahoo!?
Achetez, vendez! À votre prix! Sur http://encheres.yahoo.fr