Integrated: 8309902: C2: assert(false) failed: Bad graph detected in build_loop_late after JDK-8305189
Roland Westrelin
roland at openjdk.org
Thu Jun 29 15:09:08 UTC 2023
On Tue, 27 Jun 2023 10:02:37 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The crash happens after the following steps:
>
> 1- pre/main/post loops are created with assert predicates above the main loop.
>
> 2- the main loop is peeled
>
> 3- as a consequence, the `OpaqueZeroTripGuard` for the main loop is removed
>
> 4- That allows narrowing of the type of the CastII that was added right
> after the zero trip guard during pre/main/post loops creation
>
> 5- The CastII feeds into a range check CastII for the peeled iteration
> that becomes top because the narrowed type of the first CastII
> conflicts with the type recorded in the range check CastII.
>
> 6- The assert predicate that should fold to protect the range check
> CastII doesn't because of the fix for JDK-8282592: on assert
> predicate updates, the CastII at the zero trip guard is skipped. So
> the range check CastII sees the narrowing of the type of the CastII
> at the zero trip guard but the assert predicate doesn't.
>
> The fix I propose is to revert that part of the change from
> JDK-8282592 so both the range check CastII and the assert predicate
> have the CastII at the zero trip guard as input and observe its type
> updates. I went back to that bug and tried to reproduce the failure
> again but couldn't. Reverting JDK-8281429 causes the bug to reproduce
> again. I tried tweaking the test so the crash reproduces with
> JDK-8281429 applied but couldn't.
>
> This is caused by JDK-8305189 because step 3- happens because of
> it. Before JDK-8305189, 3- happened after loop opts are over. I think
> what happened then was that a template assertion predicate that was in
> the process of having its `OpaqueLoopInit` and `OpaqueLoopStride`
> removed constant folded so the crash wouldn't reproduce.
This pull request has now been integrated.
Changeset: 26efff75
Author: Roland Westrelin <roland at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/26efff758684b9c5615fb3b087538d713e6eca10
Stats: 64 lines in 2 files changed: 58 ins; 6 del; 0 mod
8309902: C2: assert(false) failed: Bad graph detected in build_loop_late after JDK-8305189
Reviewed-by: kvn, chagedorn
-------------
PR: https://git.openjdk.org/jdk/pull/14672
More information about the hotspot-compiler-dev
mailing list