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

C2 SuperWord: wrong result with hand unrolled loops

    XMLWordPrintable

Details

    • b19

    Backports

      Description

        This must be a relatively new regression, I think it does not affect JDK20, but certainly the newest of JDK22 and also JDK-22-ea+15-1134.

        ./java -XX:CompileCommand=compileonly,Test22::test22 -XX:CompileCommand=printcompilation,Test22::test* -XX:LoopUnrollLimit=250 -XX:UseAVX=2 -Xbatch -XX:+TraceSuperWord -XX:+TraceLoopOpts -XX:LoopMaxUnroll=8 Test22.java

        You get:
        Exception in thread "main" java.lang.RuntimeException: bad a
        at Test22.verify(Test22.java:40)
        at Test22.main(Test22.java:26)

        But with "-Xint", there is no such exception.


        I have a similar example, which also uses Unsafe:

        ./java -XX:CompileCommand=compileonly,Test21::test21 -XX:CompileCommand=printcompilation,Test21::test* -XX:LoopUnrollLimit=250 --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -XX:UseAVX=2 -Xbatch -XX:+TraceSuperWord Test21.java

        You get:
        Exception in thread "main" java.lang.RuntimeException: bad 18
        at Test21.main(Test21.java:28)

        But again, we have no exception with "-Xint".

        Attachments

          Issue Links

            Activity

              People

                epeter Emanuel Peter
                epeter Emanuel Peter
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: