RFR: 8255058: C1: assert(is_virtual()) failed: type check

Christian Hagedorn chagedorn at openjdk.java.net
Mon Nov 16 08:02:57 UTC 2020


On Fri, 13 Nov 2020 12:43:43 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

>> The following code for handling phi functions of an exception entry block in the method `LinearScan::resolve_exception_edge` assumes that pinned `Constant` instructions (executing the else case) have a virtual operand and therefore an interval assigned:
>> https://github.com/openjdk/jdk/blob/05b824567c346a7d136c01d23f56a908e7efc6d7/src/hotspot/share/c1/c1_LinearScan.cpp#L1944-L1952
>> In the testcase, however, this is not the case: A `Constant` instruction with a constant operand that is part of the long addition chain in the assignment for `iFld` (starting on L52) is pinned in `UseCountComputer::block_do`because it recursed too deeply:
>> https://github.com/openjdk/jdk/blob/05b824567c346a7d136c01d23f56a908e7efc6d7/src/hotspot/share/c1/c1_IR.cpp#L388-L392
>> https://github.com/openjdk/jdk/blob/05b824567c346a7d136c01d23f56a908e7efc6d7/src/hotspot/share/c1/c1_IR.cpp#L414-L423
>> As a result, the else case is executed in `LinearScan::resolve_exception_edge` which results in this assertion failure because `vreg_num()` only works on virtual operands that belong to an interval.
>> 
>> The fix is straight forward to also do a mapping to an interval for pinned `Constant` instructions with constant operands as we already do for non-pinned `Constant` instructions.
>> 
>> Thanks,
>> Christian
>
> Looks good!

@neliasso Thank you for your review!

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

PR: https://git.openjdk.java.net/jdk/pull/1202


More information about the hotspot-compiler-dev mailing list