[lworld] more incorrect execution due to EA pointer comparison optimization at scalarized call

XMLWordPrintable

      Patched test case fails:

      diff --git a/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestEAScalarizedArg.java b/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestEAScalarizedArg.java
      index 1edce7cb16a..2807283c7be 100644
      --- a/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestEAScalarizedArg.java
      +++ b/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestEAScalarizedArg.java
      @@ -26,7 +26,7 @@
        * @bug 8377480
        * @summary [lworld] incorrect execution due to EA pointer comparison optimization at scalarized call
        * @enablePreview
      - * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,compiler.valhalla.inlinetypes.TestEAScalarizedArg::notInlined ${test.main.class}
      + * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,compiler.valhalla.inlinetypes.TestEAScalarizedArg::notInlined* ${test.main.class}
        */
       
       package compiler.valhalla.inlinetypes;
      @@ -53,6 +53,20 @@ static int test1(Object o) {
           static Object notInlined(MyValue arg1, Object arg2) {
               return arg2;
           }
      +
      + static int test2() {
      + Object o2 = new Object();
      + MyValue v = new MyValue(null);
      + Object res = notInlined2(v);
      + if (res == null) {
      + return 1;
      + }
      + return 2;
      + }
      +
      + static Object notInlined2(MyValue arg1) {
      + return arg1;
      + }
       
           static public void main(String[] args) {
               Object o = new Object();
      @@ -60,10 +74,14 @@ static public void main(String[] args) {
               for (int i = 0; i < 20_000; i++ ) {
                   test1(o);
                   test1(null);
      + test2();
               }
               if (test1(o) != 2) {
                   throw new RuntimeException("execution failed");
               }
      + if (test2() != 2) {
      + throw new RuntimeException("execution failed");
      + }
           }
       
       }

            Assignee:
            Roland Westrelin
            Reporter:
            Roland Westrelin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: