JDK-8014286 : failed java/lang/Math/DivModTests.java after 6934604 changes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-09
  • Updated: 2013-10-18
  • Resolved: 2013-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8Fixed hs25Fixed
Related Reports
Relates :  
Relates :  
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)

Comments
noreg-sqe: existing jtreg test java/lang/Math/DivModTests.java
18-10-2013

Regression test is jdk/test/java/lang/Math/DivModTests.java. Run it with -Xcomp flag.
14-05-2013

Passed with -XX:-OptimizePtrCompare. EA should be careful optimizing pointers compare with boxing objects.
09-05-2013

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.
09-05-2013