JDK-8362171 : C2 fails with unexpected node in SuperWord truncation: ModI
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25,26
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-07-14
  • Updated: 2025-08-18
  • Resolved: 2025-07-16
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 25 JDK 26
25Fixed 26 b07Fixed
Related Reports
Causes :  
Description
After JDK-8350177, we hit the following assert in C2:

java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (workspace/open/src/hotspot/share/opto/superword.cpp:2605), pid=327591, tid=327611
#  assert(false) failed: Unexpected node in SuperWord truncation: ModI
#
# JRE version: Java(TM) SE Runtime Environment (26.0+7) (fastdebug build 26-ea+7-633)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+7-633, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1aa4154]  VLoopTypes::compute_vector_element_type()+0xcc4

Current CompileTask:
C2:2960  128    b        Test::mainTest (858 bytes)

Stack: [0x000070ca8b500000,0x000070ca8b600000],  sp=0x000070ca8b5fa670,  free space=1001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1aa4154]  VLoopTypes::compute_vector_element_type()+0xcc4  (superword.cpp:2605)
V  [libjvm.so+0x1bd0901]  VLoopAnalyzer::setup_submodules_helper()+0x91
V  [libjvm.so+0x1bd0974]  VLoopAnalyzer::setup_submodules()+0x44
V  [libjvm.so+0x15738c5]  PhaseIdealLoop::auto_vectorize(IdealLoopTree*, VSharedData&)+0x8e5
V  [libjvm.so+0x1551b8d]  PhaseIdealLoop::build_and_optimize()+0xfdd
V  [libjvm.so+0xb58043]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x4f3
V  [libjvm.so+0xb4f306]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xb6
V  [libjvm.so+0xb52071]  Compile::Optimize()+0xcc1
V  [libjvm.so+0xb5532f]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1f9f
V  [libjvm.so+0x97a437]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x467
V  [libjvm.so+0xb64698]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb58
V  [libjvm.so+0xb65868]  CompileBroker::compiler_thread_loop()+0x578
V  [libjvm.so+0x10bc88b]  JavaThread::thread_main_inner()+0x13b
V  [libjvm.so+0x1b2eb26]  Thread::call_run()+0xb6
V  [libjvm.so+0x179e698]  thread_native_entry(Thread*)+0x128

Comments
The fix for this issue is integrated in jdk-26+7-686 and jdk-25+32-3462.
16-07-2025

A pull request was submitted for review. Branch: jdk25 URL: https://git.openjdk.org/jdk/pull/26350 Date: 2025-07-16 13:34:59 +0000
16-07-2025

Changeset: 70c1ff7e Branch: master Author: Jasmine Karthikeyan <jkarthikeyan@openjdk.org> Date: 2025-07-16 12:59:55 +0000 URL: https://git.openjdk.org/jdk/commit/70c1ff7e1505eee11b2a9acd9e94a39cd2c9a932
16-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26334 Date: 2025-07-15 21:52:23 +0000
15-07-2025

I attached a simplified version of the test: java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*TestSimple*::* -XX:-TieredCompilation -Xbatch TestSimple.java
14-07-2025

ILW = Assert during C2 compilation (regression), reproducible with JavaFuzzer generated test, no workaround but disable superword or compilation of affected method = HMM = P2
14-07-2025

Jasmine, could you please have a look?
14-07-2025