Integrated: JDK-8284944: assert(cnt++ < 40) failed: infinite cycle in loop optimization

Tobias Holenstein duke at openjdk.java.net
Wed May 25 13:51:19 UTC 2022


On Wed, 18 May 2022 12:33:24 GMT, Tobias Holenstein <duke at openjdk.java.net> wrote:

> `_loop_opts_cnt` is set to `LoopOptsCount` which can have a maximum value of 43. `_loop_opts_cnt` is decremented in `PHASE_PHASEIDEALLOOP1`, `PHASE_PHASEIDEALLOOP2` and `PHASE_PHASEIDEALLOOP3` before it reaches `PHASE_PHASEIDEALLOOP_ITERATIONS` where it is decremented further in a loop until `_loop_opts_cnt` is 0. The assert assumes that `_loop_opts_cnt` has max. value 40 in `PHASE_PHASEIDEALLOOP_ITERATIONS`. But when `PartialPeelLoop` is turned off `PHASE_PHASEIDEALLOOP2` is skipped and `_loop_opts_cnt` can have max. value 41 in `PHASE_PHASEIDEALLOOP_ITERATIONS`. Therefore the assert is wrong. 
> 
> I propose to remove the assert entirely since the loop already has a condition `_loop_opts_cnt > 0` and `_loop_opts_cnt` is decremented in every iteration.

This pull request has now been integrated.

Changeset: 796494d0
Author:    Tobias Holenstein <tobias.holenstein at oracle.com>
Committer: Christian Hagedorn <chagedorn at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/796494d0fecfb9587e8b68ff1d5c09411cb82f89
Stats:     127 lines in 2 files changed: 125 ins; 2 del; 0 mod

8284944: assert(cnt++ < 40) failed: infinite cycle in loop optimization

Reviewed-by: kvn, chagedorn

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

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


More information about the hotspot-compiler-dev mailing list