RFR: 8306667: RISC-V: Fix storeImmN0 matching rule by using zr register

Xiaolin Zheng xlinzheng at openjdk.org
Fri May 12 03:46:45 UTC 2023


On Fri, 5 May 2023 09:52:00 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> The `storeImmN0` in the RISC-V backend missed a `CompressedOops::base() == NULL` predication. Under non-zero-based compressed oops mode, the `xheapbase` can be a non-zero value and crashes the VM.
>> 
>> Reproduced by `<JDK>/bin/java -Xcomp -XX:HeapBaseMinAddress=72030M -version` simply. A hs_err file is attached in the JBS issue.
>> 
>> x86 uses `r12` as a zero register in `storeImmN0`, but RISC-V has a zero register so we can use it to implement the matching rule.
>> 
>> Testing in progress.
>> 
>> Thanks,
>> Xiaolin
>
>>> And unfortunately, aarch64 has the same issue in [iRegIHeapbase](https://github.com/openjdk/jdk/blob/302bc2fd7fdfc02314e22ecc34ba2c78ef5ca9a1/src/hotspot/cpu/aarch64/aarch64.ad#L5241) since [JDK-8242449](https://bugs.openjdk.org/browse/JDK-8242449).
>>
>> Though, I think the AArch64 backend does not have this issue because it has the [CompressedOops::base() == NULL && CompressedKlassPointers::base() == NULL](https://hg.openjdk.org/jdk/jdk/rev/aedc9bf21743#l1.24) guard before JDK-8242449 - if I understand your comments correctly?
> 
> `the same issue` I mentioned means `the same unnecessary comments`. Sorry for the ambiguity.

Thanks for reviewing! @lgxbslgx @RealFYang

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

PR Comment: https://git.openjdk.org/jdk/pull/13577#issuecomment-1545065224


More information about the hotspot-compiler-dev mailing list