JDK-8362979 : C2 fails with unexpected node in SuperWord truncation: CmpLTMask, RoundF
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-07-22
  • Updated: 2025-08-03
  • Resolved: 2025-07-28
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 26
26 b09Fixed
Related Reports
Causes :  
Causes :  
Description
#  Internal Error (/home/roland/jdk-jdk/src/hotspot/share/opto/superword.cpp:2606), pid=4102033, tid=4102052
#  assert(false) failed: Unexpected node in SuperWord truncation: CmpLTMask
#
# JRE version: OpenJDK Runtime Environment (26.0) (fastdebug build 26-internal-adhoc.roland.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 26-internal-adhoc.roland.jdk-jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1993a5c]  VLoopTypes::compute_vector_element_type()+0xc9c

I see this when running CTW with:
https://repo1.maven.org/maven2/info/freelibrary/freelib-marc4j/2.6.8/freelib-marc4j-2.6.8.jar

I also see:
#  Internal Error (/home/roland/jdk-jdk/src/hotspot/share/opto/superword.cpp:2606), pid=4101992, tid=4102018
#  assert(false) failed: Unexpected node in SuperWord truncation: RoundF
#
# JRE version: OpenJDK Runtime Environment (26.0) (fastdebug build 26-internal-adhoc.roland.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 26-internal-adhoc.roland.jdk-jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1993a5c]  VLoopTypes::compute_vector_element_type()+0xc9c

with:
https://repo1.maven.org/maven2/com/actelion/research/openchemlib/2018.9.0/openchemlib-2018.9.0.jar
Comments
Thanks for the comment! I think this is indeed a bug in the test, since the PowerPC backend doesn't implement RoundF/RoundD it fails the search. I've opened a bug to fix the IR checks (JDK-8364580) and will have a patch for it soon.
03-08-2025

Hi, on the ppc64 platforms (AIX/Linux) we fail now compiler/vectorization/TestSubwordTruncation.java One or more @IR rules failed: Failed IR Rules (2) of Methods (2) ---------------------------------- 1) Method "public java.lang.Object[] compiler.vectorization.TestSubwordTruncation.testRoundD(byte[])" - [Failed IR rules: 1]: * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#ROUND_D#_", ">0"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})" > Phase "PrintIdeal": - counts: Graph contains wrong number of nodes: * Constraint 1: "(\\d+(\\s){2}(RoundD.*)+(\\s){2}===.*)" - Failed comparison: [found] 0 > 0 [given] - No nodes matched! 2) Method "public java.lang.Object[] compiler.vectorization.TestSubwordTruncation.testRoundF(byte[])" - [Failed IR rules: 1]: * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#ROUND_F#_", ">0"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})" > Phase "PrintIdeal": - counts: Graph contains wrong number of nodes: * Constraint 1: "(\\d+(\\s){2}(RoundF.*)+(\\s){2}===.*)" - Failed comparison: [found] 0 > 0 [given] - No nodes matched! Is the added check maybe too restrictive?
01-08-2025

Changeset: ea0b49c3 Branch: master Author: Jasmine Karthikeyan <jkarthikeyan@openjdk.org> Date: 2025-07-28 17:14:02 +0000 URL: https://git.openjdk.org/jdk/commit/ea0b49c36db7dce508aec7e72e73c7274d65bc15
28-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26494 Date: 2025-07-28 02:34:25 +0000
28-07-2025

Thanks a lot for the ping! I'll get a patch out for this soon.
27-07-2025

Jasmine, would you have time to take a look at this? Thanks!
23-07-2025

ILW = Assert during C2 compilation (regression), reproducible with CTW, no workaround but disable superword or compilation of affected method = HLM = P3
23-07-2025

[~jkarthikeyan] FYI
22-07-2025