[jdk20] RFR: 8299733: AArch64: "unexpected literal addressing mode" assertion failure with -XX:+PrintC1Statistics [v2]
Erik Österlund
eosterlund at openjdk.org
Mon Jan 9 11:39:59 UTC 2023
On Mon, 9 Jan 2023 11:15:42 GMT, Andrew Haley <aph at openjdk.org> wrote:
> > Isn't the real problem that _base and _index are not always initialized? If modes that don't use those registers always initialized them to noreg, at least in debug builds, then wouldn't that allow the existing uses() to work without extra overhead in product mode?
>
> I don't think it's necessarily a problem if base and _index are not always initialized, but if they aren't then they definitely shouldn't ever be read. I don't think we can rely on _base and _index being initialized, because Address contains a union, so may not even have those fields. The most robust fix is probably to make base() and index() return noreg if the mode of the Address instance doesn't have them set.
We ran into a not so fun bug in the ZGC repo, where the lack of initialization of _base and _index led to strange corruption and unintended results. We are carrying a patch locally to always initialize them, that I have been thinking of upstreaming. In the end, it seems like just initializing them is the safest option, rather than keeping track of all the exact places where reading the fields will potentially have corrupt data.
-------------
PR: https://git.openjdk.org/jdk20/pull/87
More information about the hotspot-compiler-dev
mailing list