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

failed java/lang/Math/DivModTests.java after 6934604 changes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b33

      Backports

        Description

        It failed even with EliminateAutoBox switched off:

        bash-2.05b$ bin/java -d64 -version
        java version "1.8.0-ea-fastdebug"
        Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b88)
        Java HotSpot(TM) 64-Bit Server VM (build 25.0-b32-internal-201305082235.vkozlov.6934604-fastdebug, mixed mode)
        bash-2.05b$ bin/java -d64 -XX:CICompilerCount=1 -Xcomp -XX:-EliminateAutoBox DivModTests
        FAIL: Math.floorMod(3, 3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(2, 3) = 2 differs from Math.floor(x, y): 2
        FAIL: Math.floorMod(1, 3) = 1 differs from Math.floor(x, y): 1
        FAIL: Math.floorMod(0, 3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(4, -3) = -2 differs from Math.floor(x, y): -2
        FAIL: Math.floorMod(3, -3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(2, -3) = -1 differs from Math.floor(x, y): -1
        FAIL: Math.floorMod(1, -3) = -2 differs from Math.floor(x, y): -2
        FAIL: Math.floorMod(0, -3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(-1, 3) = 2 differs from Math.floor(x, y): 2
        FAIL: Math.floorMod(-2, 3) = 1 differs from Math.floor(x, y): 1
        FAIL: Math.floorMod(-3, 3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(-4, 3) = 2 differs from Math.floor(x, y): 2
        FAIL: Math.floorMod(-1, -3) = -1 differs from Math.floor(x, y): -1
        FAIL: Math.floorMod(-2, -3) = -2 differs from Math.floor(x, y): -2
        FAIL: Math.floorMod(-3, -3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(-4, -3) = -1 differs from Math.floor(x, y): -1
        FAIL: Math.floorMod(2147483647, 1) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(2147483647, -1) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(2147483647, 3) = 1 differs from Math.floor(x, y): 1
        FAIL: Math.floorMod(2147483646, 3) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(-2147483648, 3) = 1 differs from Math.floor(x, y): 1
        FAIL: Math.floorMod(-2147483647, 3) = 2 differs from Math.floor(x, y): 2
        FAIL: Math.floorMod(-2147483647, -1) = 0 differs from Math.floor(x, y): 0
        FAIL: Math.floorMod(-2147483648, -1) = 0 differs from Math.floor(x, y): 0
        FAIL: Long.floorMod(4, 3) = 1 is different than BigDecimal result: 1
        FAIL: Long.floorMod(3, 3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(2, 3) = 2 is different than BigDecimal result: 2
        FAIL: Long.floorMod(1, 3) = 1 is different than BigDecimal result: 1
        FAIL: Long.floorMod(0, 3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(4, -3) = -2 is different than BigDecimal result: -2
        FAIL: Long.floorMod(3, -3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(2, -3) = -1 is different than BigDecimal result: -1
        FAIL: Long.floorMod(1, -3) = -2 is different than BigDecimal result: -2
        FAIL: Long.floorMod(0, -3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(-1, 3) = 2 is different than BigDecimal result: 2
        FAIL: Long.floorMod(-2, 3) = 1 is different than BigDecimal result: 1
        FAIL: Long.floorMod(-3, 3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(-4, 3) = 2 is different than BigDecimal result: 2
        FAIL: Long.floorMod(-1, -3) = -1 is different than BigDecimal result: -1
        FAIL: Long.floorMod(-2, -3) = -2 is different than BigDecimal result: -2
        FAIL: Long.floorMod(-3, -3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(-4, -3) = -1 is different than BigDecimal result: -1
        FAIL: Long.floorMod(9223372036854775807, 1) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(9223372036854775807, -1) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(9223372036854775807, 3) = 1 is different than BigDecimal result: 1
        FAIL: Long.floorMod(9223372036854775806, 3) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(-9223372036854775808, 3) = 1 is different than BigDecimal result: 1
        FAIL: Long.floorMod(-9223372036854775807, 3) = 2 is different than BigDecimal result: 2
        FAIL: Long.floorMod(-9223372036854775807, -1) = 0 is different than BigDecimal result: 0
        FAIL: Long.floorMod(-9223372036854775808, -1) = 0 is different than BigDecimal result: 0
        Exception in thread "main" java.lang.RuntimeException: 51 errors found in DivMod methods.
                at DivModTests.main(DivModTests.java:48)

          Issue Links

            Activity

            Hide
            kvn Vladimir Kozlov added a comment - - edited
            It is identity lost:

                    Object result = doFloorMod(x, y);
                        int fr = (int)ff;
                        if (fr != result) {

            The check does Boxed object compare:

            119 fast_iload #8
            121 invokestatic 18 <java/lang/Integer.valueOf(I)Ljava/lang/Integer;>
              624 bci: 121 CounterData count(1)
            124 aload_3
            125 if_acmpeq 163

            In general the test should not compare Boxing object directly. Such compare only worked for cached boxing Objects.
            Show
            kvn Vladimir Kozlov added a comment - - edited It is identity lost:         Object result = doFloorMod(x, y);             int fr = (int)ff;             if (fr != result) { The check does Boxed object compare: 119 fast_iload #8 121 invokestatic 18 <java/lang/Integer.valueOf(I)Ljava/lang/Integer;>   624 bci: 121 CounterData count(1) 124 aload_3 125 if_acmpeq 163 In general the test should not compare Boxing object directly. Such compare only worked for cached boxing Objects.
            Hide
            kvn Vladimir Kozlov added a comment -
            Passed with -XX:-OptimizePtrCompare. EA should be careful optimizing pointers compare with boxing objects.
            Show
            kvn Vladimir Kozlov added a comment - Passed with -XX:-OptimizePtrCompare. EA should be careful optimizing pointers compare with boxing objects.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/1da5d70655e9
            User: kvn
            Date: 2013-05-14 02:22:59 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/1da5d70655e9 User: kvn Date: 2013-05-14 02:22:59 +0000
            Hide
            kvn Vladimir Kozlov added a comment -
            Regression test is jdk/test/java/lang/Math/DivModTests.java. Run it with -Xcomp flag.
            Show
            kvn Vladimir Kozlov added a comment - Regression test is jdk/test/java/lang/Math/DivModTests.java. Run it with -Xcomp flag.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/1da5d70655e9
            User: amurillo
            Date: 2013-05-17 19:22:56 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/1da5d70655e9 User: amurillo Date: 2013-05-17 19:22:56 +0000
            Hide
            kvn Vladimir Kozlov added a comment -
            noreg-sqe: existing jtreg test java/lang/Math/DivModTests.java
            Show
            kvn Vladimir Kozlov added a comment - noreg-sqe: existing jtreg test java/lang/Math/DivModTests.java

              People

              • Assignee:
                kvn Vladimir Kozlov
                Reporter:
                kvn Vladimir Kozlov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: