This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: stdcall function does not return floating point result - bug in reg-stack.c


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]