[aarch64] assert(is_power_of_2(x)) failed: x must be a power of 2: 0xffffffff80000000

Andrew Haley aph at redhat.com
Wed Feb 26 14:57:37 UTC 2020


On 2/26/20 1:30 PM, Doerr, Martin wrote:
> we could use 
> STATIC_ASSERT(T(-1) > T(0));
> to disallow usage with signed types, but that would require fixing all usages.

We could do so, but the result is pretty painful. I guess it makes more
sense to specialize on the types we really need. We could do some more
template metaprogramming tricks, I guess, but that looks excessive.

> Casting int to unsinged long implies sign extend.
> So I guess that log variants like log2_int are not correct, either.

Looks like they're not, no.

-- 
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-compiler-dev mailing list