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

Vladimir Ivanov vlivanov at openjdk.java.net
Thu Jun 17 21:29:32 UTC 2021


On Tue, 15 Jun 2021 16:31:31 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
>
> Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add -XX:+UnlockDiagnosticVMOptions

Thanks for the reviews, Roland and Vladimir.

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

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


More information about the hotspot-compiler-dev mailing list