[aarch64-port-dev ] RFR(s): 8251930: AArch64: Native types mismatch in hotspot

Anton Kozlov akozlov at azul.com
Tue Aug 18 15:21:53 UTC 2020


Hi,

Could you please review a fix for C++ types mismatch in cpu/aarch64.

Bug: https://bugs.openjdk.java.net/browse/JDK-8251930
Webrev: http://cr.openjdk.java.net/~akozlov/8251930/webrev.00/

The issue was discovered by trying to compile by aarch64-darwin toolchain, but 
it just uncovered a more general problem.

Extra method overloads with for int, long, ... are added to catch all (suitable)
types used for intptr_t, int64_t. Now there are overloads only for int (for
literal values) and int64, latter usually shares a fundamental type with intptr.
The new toolchain provides different types for int64 and intptr. Then both
overloads are not perfect for an intptr argument but possible, so compilation is
failed.  Providing additional overload for intptr fixes compilation on new
toolchain but breaks linux, as intptr and int64 are different overloads for
essentially the same type.
Another approach is to leave a single overload for integer type, but literal
integer could still be ambiguously promoted to e.g. pointer or int64. So every
user will have to explicitly cast literal integers to a certain type.

Tested on aarch64-darwin (succesfully compiles cpu/aarch64 code) and
aarch64-linux toolchains. 

Thanks,
Anton



More information about the aarch64-port-dev mailing list