This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: stdcall function does not return floating point result - bug in reg-stack.c
- To: tej at melbpc dot org dot au
- Subject: Re: stdcall function does not return floating point result - bug in reg-stack.c
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Sun, 14 Feb 1999 10:52:28 -0600
- cc: egcs-bugs at cygnus dot com
Tim Josling <tej@melbpc.org.au> writes:
> From my function which I declared with the attribute __stdcall the float
> result does not get returned. The same program without stdcall works
> fine.The code generation is incorrectly popping the result from the
> stock before returning.
>
> I declare it as __stdcall (=JNICALL) to allow it to be used as a dll
> and called by Sun's Java Virtual Machine. The function is measn to
> return a float reult, but instead the floating point stack is empty.
Here's a detailed bug report that I had sent back in October, 1998.
http://www.cygnus.com/ml/egcs-bugs/1998-Oct/0773.html
Note how the fp stack popped in addition to the expected regular stack,
and that's where the problem is. In some cases, you can work aroudn the
problem by using -mno-fp-ret-in-387 when compiling the stdcall function
files, but even that has its limitations.
Thanks for the patch. I'll try it out and see if it works and check for
regressions.
Regards,
Mumit