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

JCK14: wrong optimization in compiler1

XMLWordPrintable

    • beta2
    • x86, sparc
    • generic, linux, solaris_8, windows_2000
    • Verified



      Name: kaR10181 Date: 06/05/2001



      JDK : JDK1.4.0 beta-b66
      JCK : JCK1.4
      Platform[s] : Redhat Linux 6.2, Windows 2000
      switch/Mode : -client -Xcomp
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test : lang/CLSS/clss009/clss00902/clss00902.html
                       lang/CLSS/clss009/clss00903/clss00903.html
                       lang/EXPR/expr053/expr05301/expr05301.html
                       lang/EXPR/expr777/expr77715/expr77715.html
      ****************************************************************************

      The following test shows that JVM does some wrong optimization during method
      invocation.

      -------------------------------- test.java ---------------------------------
      class d { int i = 2; }

      class c extends d {
      int init() { i += i; return i; }
      int i1 = init();
      }

      class b extends c {
      int i2 = init();
      }

      class a extends b {
      int i3 = init();
      }

      public class test {
        public static void main(String argv[]) {
        
      a f = new a();

      System.out.println("i = " + f.i);
      System.out.println("i1 = " + f.i1);
      System.out.println("i2 = " + f.i2);
      System.out.println("i3 = " + f.i3);
        }
      }
      ----------------------------------- output ---------------------------------

      linux-5$ java -Xcomp test
      i = 8
      i1 = 4
      i2 = 4 <- should be 8
      i3 = 4 <- should be 16

      ****************************************************************************

      Test source location:
      ====================
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/lang/CLSS/clss009/clss00902/clss00902.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/lang/CLSS/clss009/clss00903/clss00903.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/lang/EXPR/expr053/expr05301/expr05301.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/lang/EXPR/expr777/expr77715/expr77715.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail16/results/merlin/b66/jck14/linux/redhat6.2_smp_gnome_client_comp_linux-24/workDir/lang/CLSS/clss009/clss00902/clss00902.jtr
      /net/jtgb4u4c.eng/export/sail16/results/merlin/b66/jck14/linux/redhat6.2_smp_gnome_client_comp_linux-24/workDir/lang/CLSS/clss009/clss00903/clss00903.jtr
      /net/jtgb4u4c.eng/export/sail16/results/merlin/b66/jck14/linux/redhat6.2_smp_gnome_client_comp_linux-24/workDir/lang/EXPR/expr053/expr05301/expr05301.jtr
      /net/jtgb4u4c.eng/export/sail16/results/merlin/b66/jck14/linux/redhat6.2_smp_gnome_client_comp_linux-24/workDir/lang/EXPR/expr777/expr77715/expr77715.jtr

      How to reproduce (you may need to change JDK/JCK pathes):
      ====================

      #!/bin/sh
      JAVA_HOME=/net/jdk/export/disk8/local.java/jdk1.4/linux-i386
      JCK=/net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14
      export CLASSPATH="$JCK/classes;$JCK/javatest.jar"
      $JAVA_HOME/bin/java -Xcomp javasoft.sqe.tests.lang.clss009.clss00902.clss00902

      Test output:
      =============
      Error: res=88 expected: 96
      result: Failed.

      Specific Machine Info:
      =====================
      Hostname: linux-24, linux-2

      Additional JCK related info:
      ============================
      URL to find JCK test owners: http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      JCK FAQ: http://javaweb.eng/jck/usr/ConformanceTesting/JCKconformanceFaq.html

      =====================================================================

      ======================================================================

            dmcox David Cox (Inactive)
            akmsunw Akm Akm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: