RFR (XS) 8238909: x86_32 fails gtest:power_of_2
Aleksey Shipilev
shade at redhat.com
Wed Feb 12 18:45:30 UTC 2020
Bug:
https://bugs.openjdk.java.net/browse/JDK-8238909
Fix:
https://cr.openjdk.java.net/~shade/8238909/webrev.01/
The problem here is is_power_of_2(intptr_t), which truncates int64_t on x86_32, and replies "false"
on large power-of-two values. is_power_of_2_long(jlong) is awkward, but alternatives seem worse:
*) "LP64_ONLY(is_power_of_2(value)) NOT_LP64(is_power_of_2_long(value))" looks worse;
*) Overloading is_power_of_2(int64_t) quickly runs afoul of ambiguities on the platforms I tried;
*) Specializing the whole thing for 8-byte types seems to invite even more template madness;
Testing: affected test on {x86_64, x86_32}; jdk-submit
--
Thanks,
-Aleksey
More information about the hotspot-dev
mailing list