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

compiler2 bad code generation, result not returned from method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.3.1
    • 1.3.1
    • hotspot
    • rc1
    • sparc
    • solaris

        We have a case of incorrect code generation by Compiler2 using the latest
        (1.3.1rc1 from March 16) hotspot sources. A method in the test program
        returns the wrong result using Compiler2. Compiler1 runs the example ok.

        The attached zip file includes these files

          Test.class
          Test.java
          TestAlgorithm.class
          TestAlgorithm.java
          TestObject.class
          TestObject.java
          test.log
          test.sh

        test.sh shows the invocation of the program as I ran it with a fastdebug VM
        to produce test.log. In test.log, I have noted with "BUG:" where I think
        the problem is in the generated code. It looks like the instructions to
        assign the method return value into R_I0 (to correspond to the "load_local_object #3"
        bytecodes) have been lost by the optimizations in Compiler2.

        Further instructions from the author of the test program are:

        Attached are some Java files that should reproduce the problem.
        You should perform the following tests:

        java Test 0
        java Test 1
        java Test 2
        java -server Test 0
        java -server Test 1
        java -server Test 2

        You will notice that "java -server Test 0" will fail with throwing an
        exception.

        The differences between the tests are the following:
        Test 0: is similar to the Advisor code.
        This test works with hotspot client (Compiler1), but fails with hotspot
        server (Compiler2).
        Test 1: is a slightly modified version of the same code, just
        one if statement is different. This test works OK in both modes.
        Test 2: is the same as Test 0, the only difference is that it prints
        a message if it is about to return null. This test also works OK.

        ** See also 'Comments' section **

              cclicksunw Clifford Click (Inactive)
              clucasius Carlos Lucasius (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: