JDK-8293833 : Error mixing types with -XX:+UseCMoveUnconditionally -XX:+UseVectorCmov
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: x86
  • Submitted: 2022-09-15
  • Updated: 2022-11-01
  • Resolved: 2022-10-18
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 20
20 b20Fixed
Related Reports
Relates :  
Description
We can see failures with the following tests

compiler/c2/TestCondAddDeadBranch.java
compiler/loopopts/TestCastFFAtPhi.java

when running with -XX:+UseCMoveUnconditionally -XX:+UseVectorCmov:

make test TEST="test/hotspot/jtreg/compiler/c2/TestCondAddDeadBranch.java" JTREG="VM_OPTIONS=-XX:+UseCMoveUnconditionally -XX:+UseVectorCmov"

Error mixing types: vectory[4]:{double_top} and double_top
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (workspace/open/src/hotspot/share/opto/type.cpp:1179), pid=3589333, tid=3589359
#  Error: ShouldNotReachHere()
#
# JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-09-09-0957028.tobias.hartmann.jdk2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-09-09-0957028.tobias.hartmann.jdk2, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1a95869]  Type::typerr(Type const*) const+0x79

Current CompileTask:
C2:    130   10    b        TestCastFFAtPhi::init (35 bytes)

Stack: [0x00007ff917726000,0x00007ff917827000],  sp=0x00007ff917821540,  free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1a95869]  Type::typerr(Type const*) const+0x79  (type.cpp:1179)
V  [libjvm.so+0x1a97f2b]  TypeVect::xmeet(Type const*) const+0x1eb  (type.cpp:2451)
V  [libjvm.so+0x1a9d203]  Type::meet_helper(Type const*, bool) const+0x73  (type.cpp:879)
V  [libjvm.so+0x1a9d41a]  Type::filter_helper(Type const*, bool) const+0x1a  (type.hpp:188)
V  [libjvm.so+0x1793690]  PhaseIterGVN::transform_old(Node*)+0x230  (phaseX.cpp:1294)
V  [libjvm.so+0x178b30e]  PhaseIterGVN::optimize()+0x6e  (phaseX.cpp:1203)
V  [libjvm.so+0xafeefa]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x6da  (loopnode.hpp:1169)
V  [libjvm.so+0xafb253]  Compile::Optimize()+0xe53  (compile.cpp:2171)
V  [libjvm.so+0xafd50d]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x15ad  (compile.cpp:823)
V  [libjvm.so+0x90e2e5]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x675  (c2compiler.cpp:113)
V  [libjvm.so+0xb0ba5c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb1c  (compileBroker.cpp:2243)
V  [libjvm.so+0xb0c828]  CompileBroker::compiler_thread_loop()+0x5a8  (compileBroker.cpp:1917)
V  [libjvm.so+0x106c1dc]  JavaThread::thread_main_inner()+0x22c  (javaThread.cpp:700)
V  [libjvm.so+0x1a6dd10]  Thread::call_run()+0x100  (thread.cpp:224)
V  [libjvm.so+0x1708f13]  thread_native_entry(Thread*)+0x103  (os_linux.cpp:710)

I reproduced the bug only on AVX2 not on AVX3. So if local is on AVX3, please reproduce it with:
make test TEST="test/hotspot/jtreg/compiler/c2/TestCondAddDeadBranch.java" JTREG="VM_OPTIONS=-XX:+UseCMoveUnconditionally -XX:+UseVectorCmov -XX:UseAVX=2"
Comments
Changeset: 490fcd0c Author: Fei Gao <fgao@openjdk.org> Committer: Ningsheng Jian <njian@openjdk.org> Date: 2022-10-18 02:00:53 +0000 URL: https://git.openjdk.org/jdk/commit/490fcd0c2547cb4e564363f0cd121c777c3acc02
18-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10627 Date: 2022-10-10 06:12:11 +0000
10-10-2022

Starts to fail after JDK-8292260 which was only a backout and seems to be unrelated. Also affects JDK 19+36.
15-09-2022

ILW = C2 assertion in IGVN, only 2 tests with -XX:+UseCMoveUnconditionally -XX:+UseVectorCmov, disable UseCMoveUnconditionally and/or UseVectorCmov = HLL = P4
15-09-2022