RFR: 8261235: C1 compilation fails with assert(res->vreg_number() == index) failed: conversion check [v2]
Tobias Hartmann
thartmann at openjdk.java.net
Tue Feb 16 11:36:15 UTC 2021
On Tue, 16 Feb 2021 11:07:14 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> The assertion is hit because we run out of virtual registers in the linear scan in C1 and do not handle it. I fixed it by applying the same bailout as in `LIRGenerator::new_register()`.
>>
>> There is also a second issue that `LIR_OprDesc::vreg_max` is too big. It is only used in this bailout code. `OprBits::vreg_max` is defined over `OprBits::data_bits` which uses `OprBits::non_data_bits`. But `OprBits::non_data_bits` does not consider `OprBits::pointer_bits` which results in a too large value for `LIR_OprDesc::vreg_max` and the assertion is hit because we don't bail out, yet. This needs to be fixed as well.
>>
>> Thanks,
>> Christian
>
> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix order of non_data_bits
Looks good to me.
src/hotspot/share/c1/c1_LIR.hpp line 235:
> 233: , is_fpu_stack_offset_bits = 1 // used in assertion checking on x86 for FPU stack slot allocation
> 234: , non_data_bits = kind_bits + type_bits + size_bits + destroys_bits + last_use_bits +
> 235: is_fpu_stack_offset_bits + virtual_bits + is_xmm_bits + pointer_bits
Would be nice to have this in the same order as the enum values.
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2543
More information about the hotspot-compiler-dev
mailing list