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

Hotspot8 and Hotspot11 get different results when executing the same test case

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows 10 Professional
      10.0.19044 Build 19044
      AMD Ryzen 5 5600G with Radeon Graphics 3.90 GHz
      Memory 32 GB

      A DESCRIPTION OF THE PROBLEM :
      For the simple test case in the attachment, we get different results when we execute using JDK8 than when we execute using JDK11


      ---------- BEGIN SOURCE ----------
      public class testCase8 {
          public static int my_check_sum = 0;
          public testCase8() {}

          public void f() {
              for(int i=0;i<20;i++){
                  for(int j=0;j<5000;j++){
                      double var3 = Math.pow((double) i, (double) j);
                      my_check_sum = Integer.hashCode(my_check_sum+Double.hashCode(var3));
                  }
              }
          }

          public static void main(String[] var0) {
              testCase8 var1 = new testCase8();
              var1.f();
              System.out.print("my_check_sum_value:");
              System.out.println(my_check_sum);
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: