[lworld] C2: assert(vk->maybe_flat_in_array()) when using compareAndSetFlatValue with -XX:-UseArrayFlattening

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • repo-valhalla
    • Affects Version/s: repo-valhalla
    • Component/s: hotspot

      Attached reproducer, to run with

      javac --enable-preview --source 25 --add-exports java.base/jdk.internal.misc=ALL-UNNAMED PutFlatValueCrash.java

      java -ea --enable-preview --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -XX:-UseArrayFlattening -Xcomp -XX:CompileCommand=compileonly,"PutFlatValueCrash::test" -XX:-TieredCompilation PutFlatValueCrash


      This is because compareAndSetFlatValue uses compareAndSetFlatValueAsBytes which uses putFlatValue on a flat array (provided by newSpecialArray), which is intrinsified and crashes when UseArrayFlattening is disabled.

      Note that newSpecialArray would raise if called with -XX:-UseArrayFlattening, this is fine. But putFlatValue shouldn't crash (or be rejected) compile time because it might just be not executed at runtime.

            Assignee:
            Marc Chevalier
            Reporter:
            Marc Chevalier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: