RFR: JDK-8293978: Duplicate simple loop back-edge will crash the vm

Roland Westrelin roland at openjdk.org
Mon Sep 19 08:00:45 UTC 2022


On Mon, 19 Sep 2022 03:30:15 GMT, 王超 <duke at openjdk.org> wrote:

> Duplicate back-edge of the following simple loop will make jvm crash.
> 
> <img width="458" alt="image" src="https://user-images.githubusercontent.com/25214855/190945327-ebce5342-bede-4fad-b940-088753034fa6.png">

Changes requested by roland (Reviewer).

src/hotspot/share/opto/loopopts.cpp line 3972:

> 3970:   }
> 3971: 
> 3972:   if (idom(region)->is_Catch() || region == head) {

That check could be done earlier I think at the test for:
 `if (!incr->is_Phi()) {`

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

PR: https://git.openjdk.org/jdk/pull/10329


More information about the hotspot-compiler-dev mailing list