[jdk17] RFR: 8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed
Roland Westrelin
roland at openjdk.java.net
Tue Jun 15 15:07:39 UTC 2021
On Tue, 15 Jun 2021 11:47:32 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> The way `CheckCastPP` nodes are handled now doesn't let redundant casts to be completely removed: even when the corresponding runtime check disappears, the cast node stays in the graph and it broadens/worsens the type of casted value.
>
> Proposed fix leaves `CheckCastPP` handling intact, but skips the insertion of redundant cast nodes as part of receiver subtype check.
>
> Also, interface casts on receiver temporarily don't get a `CheckCastPP` irrespective of whether the subtype check is redundant or not.
>
> Though the assertion failures showed up after JDK-8267807, the bug was there long before.
>
> Testing:
> - [x] hs-tier1 - hs-tier4
Looks good to me.
-------------
Marked as reviewed by roland (Reviewer).
PR: https://git.openjdk.java.net/jdk17/pull/55
More information about the hotspot-compiler-dev
mailing list