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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • 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.

            mchevalier Marc Chevalier
            mchevalier Marc Chevalier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: