This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bugs with __stdcall
- From: "Igor" <riv at selena dot net dot ua>
- To: <bug-gcc at gnu dot org>
- Date: Fri, 23 Aug 2002 00:10:05 +0400
- Subject: bugs with __stdcall
excuse me for my english.
I'm used - gcc version 3.2 (mingw special 20020817-1), system - Windows 98
example:
name file - pr.cpp
--------------------------------------
__stdcall int func( int a, int b )
{
return a + b;
}
int main()
{
func( 1, 2 );
return 0;
}
---------------------------------------
compiled: gcc -Os -S -mregparm=3 pr.cpp
view pr.s
......
.def __Z4funcii@8; .scl 2; .type 32; .endef
__Z4funcii@8:
LFB1:
pushl %ebp
LCFI0:
addl %edx, %eax
movl %esp, %ebp
LCFI1:
popl %ebp
ret
LFE1:
.def ___main; .scl 2; .type 32; .endef
.align 2
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
LFB2:
pushl %ebp
LCFI2:
movl %esp, %ebp
LCFI3:
call ___main
movl $1, %eax ; WHY? Function is attribute __stdcall!
Parameters must push on stack!
movl $2, %edx ;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
call __Z4funcii@8
popl %ebp
xorl %eax, %eax
ret
LFE2:
........................
if compiled without -mrefparm=3, then parameters is push on stack
Igor Ranuk.
city: Kherson, country: Ukrain