RFR: JDK-8284944: assert(cnt++ < 40) failed: infinite cycle in loop optimization [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 24 00:41:51 UTC 2022
On Wed, 18 May 2022 13:06:45 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.
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
>
> reformat spaces in test
The original Test.java did not finish after 1000 iterations and I don't see what loop opts it executed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8767
More information about the hotspot-compiler-dev
mailing list