Running the attached program (Crash.java) on a 32-bits x86 debug VM using
$ java -Xcomp -XX:CompileOnly=Crash::createAndClone Crash.java
triggers the following assertion failure:
# A fatal error has been detected by the Java Runtime Environment:
#
# src/hotspot/share/opto/compile.cpp:4004), pid=87530, tid=87544
# assert(n->outcnt() == required_outcnt) failed: malformed control flow
#
# JRE version: Java(TM) SE Runtime Environment (22.0) (fastdebug build 22-internal-2023-09-18-0751569.roberto.castaneda.lozano.JDK-2215)
# Java VM: Java HotSpot(TM) Server VM (fastdebug 22-internal-2023-09-18-0751569.roberto.castaneda.lozano.JDK-2215, compiled mode, tiered, g1 gc, linux-x86)
# Problematic frame:
# V [libjvm.so+0x80b4d7] Compile::final_graph_reshaping()+0x757
The program creates and clones an array as large as allowed by arrayOopDesc::max_array_length(T_BYTE) on a 32-bits platform using default object alignment (8 bytes). The same assertion failure can be triggered for a 'short' array of 0x7ffffff8 elements.