RFR: 8255058: C1: assert(is_virtual()) failed: type check
Christian Hagedorn
chagedorn at openjdk.java.net
Fri Nov 13 12:06:10 UTC 2020
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
-------------
Commit messages:
- 8255058: C1: assert(is_virtual()) failed: type check
Changes: https://git.openjdk.java.net/jdk/pull/1202/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1202&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8255058
Stats: 74 lines in 2 files changed: 71 ins; 1 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/1202.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1202/head:pull/1202
PR: https://git.openjdk.java.net/jdk/pull/1202
More information about the hotspot-compiler-dev
mailing list