JDK-8260716 : Assert in MacroAssembler::clear_mem with -XX:-IdealizeClearArrayNode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-01
  • Updated: 2021-03-30
  • Resolved: 2021-03-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 17
17 b15Fixed
Related Reports
Relates :  
Description
#  Internal Error (/oracle/jdk/open/src/hotspot/cpu/x86/macroAssembler_x86.cpp:5000), pid=401730, tid=401747
#  Error: assert(UseAVX > 2 && VM_Version::supports_avx512vlbw()) failed

Current CompileTask:
C2:    221  166       4       java.io.DataInputStream::readUTF (501 bytes)

Stack: [0x00007f7e80432000,0x00007f7e80533000],  sp=0x00007f7e8052dcf0,  free space=1007k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x13362b0]  MacroAssembler::clear_mem(RegisterImpl*, int, RegisterImpl*, XMMRegisterImpl*)+0x90
V  [libjvm.so+0x399068]  rep_stos_imNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x138
V  [libjvm.so+0x155ddfa]  PhaseOutput::scratch_emit_size(Node const*)+0x3fa
V  [libjvm.so+0x1554cbc]  PhaseOutput::shorten_branches(unsigned int*)+0x2ac
V  [libjvm.so+0x15666aa]  PhaseOutput::Output()+0xcca
V  [libjvm.so+0xa10048]  Compile::Code_Gen()+0x438
V  [libjvm.so+0xa1af6c]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x19dc
V  [libjvm.so+0x84737a]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
V  [libjvm.so+0xa2ada1]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xea1
V  [libjvm.so+0xa2ba28]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x184d476]  JavaThread::thread_main_inner()+0x256
V  [libjvm.so+0x1853de0]  Thread::call_run()+0x100
V  [libjvm.so+0x153e956]  thread_native_entry(Thread*)+0x116
Comments
Changeset: ff52f298 Author: Jamsheed Mohammed C M <jcm@openjdk.org> Date: 2021-03-18 09:22:17 +0000 URL: https://git.openjdk.java.net/jdk/commit/ff52f298
18-03-2021

probably this predicate will fix it. diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index 13b8125ad10..77844222e18 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -10747,7 +10747,7 @@ instruct MoveL2D_reg_reg(regD dst, rRegL src) %{ instruct rep_stos(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero, Universe dummy, rFlagsReg cr) %{ - predicate(!((ClearArrayNode*)n)->is_large() && !n->in(2)->bottom_type()->is_long()->is_con()); + predicate(!((ClearArrayNode*)n)->is_large() && (UseAVX <= 2 || !VM_Version::supports_avx512vlbw() || !n->in(2)->bottom_type()->is_long()->is_con())); match(Set dummy (ClearArray cnt base)); effect(USE_KILL cnt, USE_KILL base, TEMP tmp, KILL zero, KILL cr); @@ -10855,7 +10855,7 @@ instruct rep_stos_large(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero, instruct rep_stos_im(immL cnt, rRegP base, regD tmp, rRegI zero, Universe dummy, rFlagsReg cr) %{ - predicate(!((ClearArrayNode*)n)->is_large() && n->in(2)->bottom_type()->is_long()->is_con()); + predicate(!((ClearArrayNode*)n)->is_large() && (UseAVX > 2 && VM_Version::supports_avx512vlbw() && n->in(2)->bottom_type()->is_long()->is_con())); match(Set dummy (ClearArray cnt base)); effect(TEMP tmp, TEMP zero, KILL cr); format %{ "clear_mem_imm $base , $cnt \n\t" %}
16-03-2021

ILW = Assert during C2 compilation, easy to reproduce with stress flag, disable compilation of affected method = HLM = P3
01-02-2021