[jdk20] RFR: 8299733: AArch64: "unexpected literal addressing mode" assertion failure with -XX:+PrintC1Statistics [v3]
Kim Barrett
kbarrett at openjdk.org
Wed Jan 11 01:26:20 UTC 2023
On Tue, 10 Jan 2023 10:37:41 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> This file seems to have both styles, but the other switch statements in the `Assembler` class are indented like this (e.g. see `encode()` below).
>
> Yeah, indeed. I even noticed this kind of coding style inconsistency in hotspot shared code. I guess it's OK to align with the surrounding code. Looks good to me. PS: I will prepare a similar enhancement for RISC-V on JDK master.
Coming late to the party. Sorry I didn't notice this earlier.
When working on 8297830 I noticed that `uses()` had been problematic for
various modes, due to possibly uninitialized members. I assumed it wasn't
being used for such since I didn't find any relevant bug reports. And my
changes added asserts that would fire if I was wrong about that, and I didn't
see any in fairly broad testing.
The structure of the unionization done by 8297830 makes it easy to add the
additional loosening to support literals in `uses()`. For non-literal modes
that don't have an index register, `index()` is always initialized to `noreg`.
For `no_mode`, `base()` and `index()` are initialized to `noreg` by design, to
make these sorts of things easy and not needing to explicitly check for that
uncommon case. So no switch statement is needed, just a test for (non)literal.
So the following is sufficient:
bool uses(Register reg) const {
return _mode != literal && (base() == reg || index == reg);
}
-------------
PR: https://git.openjdk.org/jdk20/pull/87
More information about the hotspot-compiler-dev
mailing list