[jdk17] Integrated: 8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed

Vladimir Ivanov vlivanov at openjdk.java.net
Thu Jun 17 21:29:34 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

This pull request has now been integrated.

Changeset: 9130b8a9
Author:    Vladimir Ivanov <vlivanov at openjdk.org>
URL:       https://git.openjdk.java.net/jdk17/commit/9130b8a9d7ebd943108f01d41ed777e080f34c4d
Stats:     205 lines in 2 files changed: 187 ins; 1 del; 17 mod

8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed

Reviewed-by: roland, kvn

-------------

PR: https://git.openjdk.java.net/jdk17/pull/55


More information about the hotspot-compiler-dev mailing list