This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/12236] New: regparm and fastcall messes up parameters
- From: "lightspeed at as dot ro" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2003 09:53:32 -0000
- Subject: [Bug other/12236] New: regparm and fastcall messes up parameters
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12236
Summary: regparm and fastcall messes up parameters
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: critical
Priority: P1
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lightspeed at as dot ro
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: linux redhat 9 & Windows 98
The bug is that function buggycall gets its parameters heavily messed up!!
All functions should output its parameters' values
like 1,2,3,4. Functions buggycall2 and buggycall3 output "1,2,3,4" as they
should, but function buggycall outputs "4 0 1097054101 134513542" that is
NOT what got passed to it.
This looks like a parameter passing error, and as you can see from the
source file it only occurs when I don't declare a prototype for the function
and I put the calling convention after the return type. Putting the calling
convention before the return type solves the problem, but then my program
doesn't compiles with MSVC++, cause it is a violation of its syntax(I guess).
This bug occurs both with gcc and g++. This bug occurs in mingw32 too.