This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/34001] Incorrect x86 fastcall behavior
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Nov 2007 03:27:06 -0000
- Subject: [Bug target/34001] Incorrect x86 fastcall behavior
- References: <bug-34001-15308@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from hjl at lucon dot org 2007-11-12 03:27 -------
>From "info gcc",
`fastcall'
On the Intel 386, the `fastcall' attribute causes the compiler to
pass the first argument (if of integral type) in the register ECX
^^^^^^^^^^^^^^^^^^^
and the second argument (if of integral type) in the register EDX.
^^^^^^^^^^^^^^^^^^^
Subsequent and other typed arguments are passed on the stack.
The called function will pop the arguments off the stack. If the
number of arguments is variable all arguments are pushed on the
stack.
It looks like gcc document follows MS compiler and we didn't implement
it correctly.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34001