diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 318c9f424b4..e794bd48743 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -575,7 +575,7 @@ class Address { static bool offset_ok_for_immed(int64_t offset, int shift) { unsigned mask = (1 << shift) - 1; if (offset < 0 || offset & mask) { - return (uabs(offset) < (1 << (20 - 12))); // Unscaled offset + return (uabs((long)offset) < (1 << (20 - 12))); // Unscaled offset } else { return ((offset >> shift) < (1 << (21 - 10 + 1))); // Scaled, unsigned offset }