RFR: 8296924: C2: assert(is_valid_AArch64_address(dest.target())) failed: bad address [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Nov 29 16:53:22 UTC 2022
On Tue, 29 Nov 2022 12:15:32 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> With (unreachable) unsafe accesses, it can happen that the base address is invalid. On AArch64, C2 will emit a `loadConP` for loading the constant address that is implemented by [aarch64_enc_mov_p](https://github.com/openjdk/jdk/blob/48017b1d9c3a7867984f54d61f17c7f034d213f5/src/hotspot/cpu/aarch64/aarch64.ad#L3366) calling [MacroAssembler::adrp](https://github.com/openjdk/jdk/blob/48017b1d9c3a7867984f54d61f17c7f034d213f5/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L4576). The `adrp` implementation then asserts in [is_valid_AArch64_address](https://github.com/openjdk/jdk/blob/48017b1d9c3a7867984f54d61f17c7f034d213f5/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp#L1321), assuming that we can only ever load constant pointers that are within the 48-bit AArch64 address space.
>>
>> The fix, proposed by @theRealAph, is to emit a full-blown `mov` in case of a bad address.
>>
>> Thanks,
>> Tobias
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>
> Update src/hotspot/cpu/aarch64/aarch64.ad
>
> Co-authored-by: Andrew Haley <aph-open at littlepinkcloud.com>
Good.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11412
More information about the hotspot-compiler-dev
mailing list