RFR: 8308504: C2: "malformed control flow" after JDK-8303466
Roland Westrelin
roland at openjdk.org
Thu Jun 22 12:29:03 UTC 2023
On Thu, 22 Jun 2023 12:18:21 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> > It doesn't seem to be true that the loop incr never overflows in the general case. See this example:
>
> But don't we check that the limit is small enough at runtime, such that there cannot be an overflow? We do that with `check_stride_overflow` and `insert_loop_limit_check_predicate`. And if it does overflow, we do not go into the counted-loop, but we uncommon trap, I think. Or are you sure that we actually enter the counted-loop with your example? Or just some peeled version?
Ran with:
-XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation -XX:CompileOnly=TestOverflowCountedLoopIncr::test -XX:CompileCommand=quiet -XX:LoopMaxUnroll=0 -XX:+UseCountedLoopSafepoints
I see a single counted loop, no uncommon trap in the IR.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14331#issuecomment-1602548414
More information about the hotspot-compiler-dev
mailing list