Windows integral promotions / uint64_t

Andrew Haley aph-open at littlepinkcloud.com
Thu Apr 28 12:53:45 UTC 2022


I'm seeing this failure from the Windows/AArch64 C++ compiler:

* For target hotspot_variant-server_libjvm_objs_stubGenerator_aarch64.obj:
stubGenerator_aarch64.cpp
d:\a\jdk\jdk\jdk\src\hotspot\cpu\aarch64\stubGenerator_aarch64.cpp(6524): error C2668: 'MacroAssembler::sub': ambiguous call to overloaded function
d:\a\jdk\jdk\jdk\src\hotspot\cpu\aarch64\macroAssembler_aarch64.hpp(1174): note: could be 'void MacroAssembler::sub(Register,Register,Register)'
d:\a\jdk\jdk\jdk\src\hotspot\cpu\aarch64\macroAssembler_aarch64.hpp(1174): note: or       'void MacroAssembler::sub(Register,Register,uint64_t)'
d:\a\jdk\jdk\jdk\src\hotspot\cpu\aarch64\stubGenerator_aarch64.cpp(6524): note: while trying to match the argument list '(const Register, const Register, unsigned int)'
    ... (rest of output omitted)

6524:   __ sub(sp, rfp, ((unsigned)framesize-4) << LogBytesPerInt); // prolog


Is this a known bug in the compiler? It seems to me as though there is
an implicit integral promotion from unsigned int to uint64_t, but there is no
implicit conversion from unsigned int to Register (which is of pointer-
to const RegisterImpl type). Therefore, according to the ranking of
implicit conversion sequences rule, this should work.

Or is the problem that, according to the Windows compiler, there is no
implicit integral promotion from unsigned int to uint64_t? I guess that's
possible if there is no standard type which corresponds to uint64_t, but
surely that's unsigned long long. Isn't it?

If this is the case, we could use some template magic to define conversions
from the standard types to Xint64_t, and include them in the Windows build.
That would reduce the pain.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list