This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
unneeded stuff when call
- From: RomikB <romikb at mail dot ru>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 3 Jul 2003 23:20:41 +0300
- Subject: unneeded stuff when call
- Organization: RBG
- Reply-to: RomikB <romikb at mail dot ru>
Hello,
I have a source:
long var_x;
void func()
{
var_x = 55;
}
compile it (-S -O2 -fomit-frame-pointer file.c), and get
_func:
movl $55, _var_x
ret
---------------------------------------------------------
after I append some lines:
long var_x;
typedef void (*functype)();
void func()
{
var_x = 55;
((functype)var_x)();
}
compile it (-S -O2 -fomit-frame-pointer file.c), and get
_func:
subl $12, %esp (1)
movl $55, %eax
movl $55, _var_x
call *%eax
addl $12, %esp (1)
ret
WHY compiler add lines (1)? It don't needed there!
Can compiler don't generate this lines?
gcc -v
gcc version 3.2.3 (mingw special 20030504-1)
--
Best regards,
RomikB mailto:romikb@mail.ru