RFR: JDK-8284944: assert(cnt++ < 40) failed: infinite cycle in loop optimization [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 24 00:48:39 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
I think first thing to do is to make sure we got report about what cause `major_progress` to be `true` in those loop opts iteration. Currently I see only repeated output in Test.java.
I also found that without "Strip Mining" (I used -XX:+UseParallelGC because I can't find how to switch it off otherwise) the Test.java finished in 9 iterations (cnt == 7) !!! So it is definitely something wrong when we use "Strip Mining" in this test.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8767
More information about the hotspot-compiler-dev
mailing list