RFR: 8145096: Undefined behaviour in HotSpot
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Dec 29 10:04:08 UTC 2015
Looks fine to me too. I am pushing it.
Thanks,
Vladimir
On 12/21/15 9:07 AM, Andrew Haley wrote:
> I've analysed the last remaining changes and I'm now convinced that
> it's safe to make this change:
>
> --- a/src/share/vm/opto/mulnode.cpp
> +++ b/src/share/vm/opto/mulnode.cpp
> @@ -574,7 +574,8 @@
> // Masking off high bits which are always zero is useless.
> const TypeLong* t1 = phase->type( in(1) )->isa_long();
> if (t1 != NULL && t1->_lo >= 0) {
> - jlong t1_support = ((jlong)1 << (1 + log2_long(t1->_hi))) - 1;
> + int bit_count = log2_long(t1->_hi) + 1;
> + jlong t1_support = jlong(max_julong >> (BitsPerJavaLong - bit_count));
> if ((t1_support & con) == t1_support)
> return usr;
> }
>
> Webrev at http://cr.openjdk.java.net/~aph/8145096-4/
>
> Andrew.
>
More information about the hotspot-dev
mailing list