Integrated: 8314106: C2: assert(is_valid()) failed: must be valid after JDK-8305636
Christian Hagedorn
chagedorn at openjdk.org
Mon Aug 14 08:40:28 UTC 2023
On Thu, 10 Aug 2023 13:35:46 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> In the failing test case, we are unswitching a loop for which we've already removed Parse Predicates with `Compile::cleanup_parse_predicates()`. We are wrongly checking if a predicate block is non-empty (i.e. find the Parse **or** Runtime Predicates) instead of only checking if we find the Parse Predicate:
> https://github.com/openjdk/jdk/blob/23fe2ece586d3ed750e905e1b71a2cd1da91f335/src/hotspot/share/opto/loopPredicate.cpp#L448-L453
>
> In the test case, we have a predicate block that contains Runtime Predicates from Loop Predication but no Parse Predicate anymore. Therefore, when trying to clone the non-existing Parse Predicate, we fail with the assertion because we do not have a valid Parse Predicate.
>
> The fix is to only clone a Parse Predicate and the Assertion Predicates for a predicate block if the Parse Predicate is actually there. This is not entirely correct because we would also need to clone Assertion Predicates in the absence of Parse Predicates. But this was already wrong before JDK-8305636:
> https://github.com/openjdk/jdk/blob/a38fdaf18dfeeb23775516d1986c720190ba9fc2/src/hotspot/share/opto/loopPredicate.cpp#L598-L612
>
> This will only be fixed with the complete fix ([JDK-8288981](https://bugs.openjdk.org/browse/JDK-8288981)). The proposed fix here just reverts back to the old behavior before JDK-8305636.
>
> Thanks,
> Christian
This pull request has now been integrated.
Changeset: 1de5bf1c
Author: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/1de5bf1ce94c20bc2fd481cd4387f170b0d3c63d
Stats: 68 lines in 2 files changed: 66 ins; 1 del; 1 mod
8314106: C2: assert(is_valid()) failed: must be valid after JDK-8305636
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/15225
More information about the hotspot-compiler-dev
mailing list