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

Load from initializing arraycopy uses wrong memory state

XMLWordPrintable

    • b21
    • Verified

            static int test1() {
                int[] src = new int[10];
                test_dummy = src;
                int[] dst = new int[10];
                src[1] = 0x42;
                System.arraycopy(src, 1, dst, 1, 9);
                return dst[1];
            }

        generates a load from src[1] on the raw memory slice that can be reordered with the store to src[1]. Always fail on 8. Only fail on 9 & 10 if we're unlucky with load scheduling.

              roland Roland Westrelin
              roland Roland Westrelin
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: