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

JIT violates statements execution order

    XMLWordPrintable

    Details

      Description



      Name: laC46010 Date: 05/16/97



      JIT 210.046 for JDK 1.1.2 do not execute some statements
      if followed statement completes abruptly and throws
      a runtime exception. In the following example,
      it looks like statements
              i++;
      j=m+1;
      m=8;
      are not executed at all and variable values are not changed
      properly when ArithmeticException is thrown from
              k = 10/(n - 2);


      [H:/ld12/java/leo/java/bug/jit/expr] jc -d . excp02301.java; ja excp02301
      Symantec Java! JustInTime Compiler Version 210.046 for JDK 1.1.2
      Copyright (C) 1996-97 Symantec Corporation
      Symantec Java! JustInTime Compiler Version 210.046 for JDK 1.1.2
      Copyright (C) 1996-97 Symantec Corporation
      in catch:0 0 0 0
      at exit:0 0 0 0

      ---------------------------------------------------------
      public class excp02301 {
        public static void main(String argv[]) {
           int n = 2;
           int i = 0; int j = 0; int m=0;
           int k = 0;
           try {
              i++;
      j=m+1;
      m=8;
              k = 10/(n - 2);
           }
           catch (ArithmeticException e) {
            System.out.println ("in catch:" + i + " " + k + " " + j+ " " + m);
           }
           System.out.println ("at exit:" + i + " " + k + " " + j+ " " + m);
        }
        static int val() {return 8;};
      }
      ---------------------------------------------------------

      The same bug happens also on other JCK111a tests listed below:

      lang/EXCP/excp023/excp02301 a1 = 10/n; a2 = 10/(n - 2); a1 not assigned
      lang/EXCP/excp023/excp02302 a1 = 10%n; a2 = 10%(n - 3); a1 not assigned
      lang/STMT/stmt004/stmt00403 a4 = 2; a2 = 10/(a2-1); wrong values of a4, a2
      lang/STMT/stmt043/stmt04302 a3 += 1; b = b/(b-2); a4 += 1; a3 not assigned
      lang/STMT/stmt053/stmt05302 a1 += 1; c = c/(c-2); a2 += 1; a1 not assigned
      lang/STMT/stmt065/stmt06502 a1 += 1; b += 5/(b-2); b++; a2 += 1; a1 not assigned
      lang/STMT/stmt068/stmt06802 for ( c = 1, a1 += 1, j = 1/(a2-a3), a2 += 1; j < 2; j++ ) {a3 += 1;} a1 not assigned
      lang/STMT/stmt105/stmt10501 a1 = 1; throw proc1();
      lang/STMT/stmt114/stmt11404 a1 ++; a2 = 5 / a3; a1 not assigned before exception thrown
      lang/STMT/stmt124/stmt12402 a4 ++; a[3] = 2; a4 not assigned before exception thrown


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

        Attachments

          Activity

            People

            Assignee:
            dviswanasunw Deepa Viswanathan (Inactive)
            Reporter:
            leosunw Leo Leo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: