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

SSE leads to different double results on x86 platforms

XMLWordPrintable

    • x86
    • generic

      The following code:
      ---------------------------------------------------
      public class Tester {
          public static void main(String[] args)
          {
              double var_01 = 1.123456789E308;

              double var_02 = 1E10 % ((byte)1E10F / var_01);;

              System.out.println("var_02 = " + var_02);
          }
      }
      ---------------------------------------------------

      leads to wrong results when running with client compiler on x86 platforms
      (checked on linux, solaris, didn't check on windows).
      The problem doesn't exist on sparc.

      > java -client -Xint Tester
      var_02 = 1.775911491144526E-309

      > java -client -Xcomp -XX:CompileOnly=Tester Tester
      var_02 = 8.45714628570092E-309

            never Tom Rodriguez
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: