JDK-4898278 : C1: Improper return of extra-precise fp values from native methods on windows
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-07-30
  • Updated: 2003-11-25
  • Resolved: 2003-11-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b30Fixed
Related Reports
Relates :  
Relates :  
Description
In the course of writing tests for the hyperbolic transcendental functions (4851625), I noticed some anomolies in the test output.  Namely a value returned from a Java method and a native floating-point method did not compare as equal but had the same represention when printed out as a long bit pattern (i.e. same result from Double.longBitsToDouble).  The values are no where near the overflow or underflow threshold so strictfp vs non-strictfp is not an issue.  The problem persists even when the method is declared strictfp.  Moreover, the results are written to local variables (which javac correctly preserves with dstore instructions) so both values must be members of the double value set.

I suspect C1 does not always clamp a long-double return value from a native method to double in some situations.  The problem does not occur when Java is invoked with -Xint, -server, -Xcomp -client, or -Xcomp -server.  The problem does not occur under Linux x86, at least not with the test program in question.

Tar ball of relevant files attached; run the HyperbolicsDiffFinderBug program.

The failure occured when the coding idiom

if( (local1=nativeSinh(d)) != (fdlibm1=StrictMath.sinh(d)) )

is used but not when

local1=nativeSinh(d);
fdlibm1=StrictMath.sinh(d);
if(loca1 != fdlibm1)

is used.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b30 tiger-beta
14-06-2004

EVALUATION The native wrapper needs to store double valeus down to the stack to round them. ###@###.### 2003-10-23
23-10-2003