Integrated: 8296924: C2: assert(is_valid_AArch64_address(dest.target())) failed: bad address
Tobias Hartmann
thartmann at openjdk.org
Wed Nov 30 06:42:24 UTC 2022
On Tue, 29 Nov 2022 11:55:51 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
This pull request has now been integrated.
Changeset: abe532a8
Author: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/abe532a89cbdd2b959789611cecbad7c94f6a870
Stats: 59 lines in 2 files changed: 58 ins; 0 del; 1 mod
8296924: C2: assert(is_valid_AArch64_address(dest.target())) failed: bad address
Co-authored-by: Andrew Haley <aph at openjdk.org>
Reviewed-by: aph, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/11412
More information about the hotspot-compiler-dev
mailing list