RFR: 8367028: compiler/c2/irTests/TestFloat16ScalarOperations.java failing intermittently because of constant folding

Emanuel Peter epeter at openjdk.org
Mon Dec 8 16:45:42 UTC 2025


The test uses random constants. But we forgot to exclude special values such as `zero`, otherwise the operations can be folded (idealized) and the IR tests fail. For example `x + 0.42` would not be folded, but `x + 0` would be folded to `x`.

Solution: restrict the range we sample from. Used to be `[0, 1)`, now I just do `[0.1, 0.9)`.

-------------

Commit messages:
 - rm line
 - fix
 - JDK-8367028

Changes: https://git.openjdk.org/jdk/pull/28678/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28678&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8367028
  Stats: 17 lines in 1 file changed: 9 ins; 0 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/28678.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28678/head:pull/28678

PR: https://git.openjdk.org/jdk/pull/28678


More information about the hotspot-compiler-dev mailing list