JDK-8372046 : compiler/floatingpoint/TestSubNodeFloatDoubleNegation.java fails IR verification
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2025-11-18
  • Updated: 2025-11-18
Related Reports
Causes :  
Description
Run this test with fastdebug build on platforms without native support for float16:

$ make test TEST="compiler/floatingpoint/TestSubNodeFloatDoubleNegation.java"

```
One or more @IR rules failed:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "public static jdk.incubator.vector.Float16 compiler.floatingpoint.TestSubNodeFloatDoubleNegation.testHalfFloat(jdk.incubator.vector.Float16)" - [Failed IR rules: 1]:
   * @IR rule 5: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#SUB#_", "2"}, applyIfPlatform={"riscv64", "true"}, failOn={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={"zfh", "false"}, applyIfAnd={}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(\d+(\s){2}(Sub(I|L|F|D|HF).*)+(\s){2}===.*)"
           - Failed comparison: [found] 3 = 2 [given]
             - Matched nodes (3):
               * 400  SubF  === _ 954 398  [[ 528 479 446 472 472 470 470 ]]  !jvms: Float16::subtract @ bci:8 (line 1185) TestSubNodeFloatDoubleNegation::testHalfFloat @ bci:9 (line 67)
               * 516  SubI  === _ 22 515  [[ 528 ]]  !jvms: Float::floatToFloat16 @ bci:71 (line 1172) Float16::valueOf @ bci:5 (line 361) Float16::subtract @ bci:9 (line 1185) TestSubNodeFloatDoubleNegation::testHalfFloat @ bci:9 (line 67)
               * 861  SubI  === _ 22 860  [[ 873 ]]  !jvms: Float::floatToFloat16 @ bci:71 (line 1172) Float16::valueOf @ bci:5 (line 361) Float16::subtract @ bci:9 (line 1185) TestSubNodeFloatDoubleNegation::testHalfFloat @ bci:12 (line 65)

>>> Check stdout for compilation output of the failed methods
```

The reason is that method `Float::floatToFloat16` is inlined into method `TestSubNodeFloatDoubleNegation.testHalfFloat`, which causes unexpected IR graph. One way to fix this would be disabling inlining of methods from the Float class.
Comments
Please file compiler test bugs in hotspot/compiler, not in hotspot/test. Thanks!
18-11-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28364 Date: 2025-11-18 04:57:47 +0000
18-11-2025