Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4898278

C1: Improper return of extra-precise fp values from native methods on windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 5.0
    • hotspot
    • b30
    • x86
    • windows_nt

      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.

            never Tom Rodriguez
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: