RFR: 8273317: crash in cmovP_cmpP_zero_zeroNode::bottom_type()

SUN Guoyun github.com+40024232+sunny868 at openjdk.java.net
Thu Sep 30 02:23:32 UTC 2021


On Sat, 4 Sep 2021 02:58:56 GMT, SUN Guoyun <github.com+40024232+sunny868 at openjdk.org> wrote:

> Hi all,
> 
> When I implement a new instruct in adfile for match CMoveP with Cmp node,like this:
> 
> match(Set dst (CMoveP (Binary cop (CmpP op1 zero)) (Binary dst zero)));
> 
> this means right child of CmpP is immediate zero and right child of CmovP also is immediate zero, then an exception will occur:
> 
> <pre><code class="shell">
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # SIGSEGV (0xb) at pc=0x000000fff410fcc4, pid=11130, tid=11146
> #
> # JRE version: OpenJDK Runtime Environment (17.0) (build 17-internal+0-jenkins-slave-20210821140615-jdk-ls-a526852e137)
> # Java VM: OpenJDK 64-Bit Server VM (17-internal+0-jenkins-slave-20210821140615-jdk-ls-a526852e137, compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-loongarch64)
> # Problematic frame:
> # V [libjvm.so+0x21fcc4] cmovP_cmpP_zero_zeroNode::bottom_type() const+0x44
> #
> # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
> #
> # If you would like to submit a bug report, please visit:
> # https://bugreport.java.com/bugreport/crash.jsp
> #
> </code></pre>
> 
> In this case, cmovP_ cmpP_ zero_ zeroNode only has three input nodes, so an exception is triggered. This is a patch to fix this problem. Please help review it 
> 
> Thanks,
> Sun Guoyun

In MIPS architecture and LoongArch architecture, there is no program status register (similar to CPSR in aarch64). For performance reasons, we do not use the operand RegFlags, but put node CMP and node CMove in a match, similar to 

CMove (binary cmp (Cmp cmp1 cmp2)) (binary src1 src2)

here CMove and Cmp type can be INT/LONG/POINTER/NARROW and so on.  When cmp2 is 0 and src2 is 0, MIPs and LoongArch can be implemented with fewer machine instructions, but the support of this patch is required.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5369


More information about the hotspot-compiler-dev mailing list