# HG changeset patch # User Stefan Anzinger # Date 1434448535 -7200 # Node ID 107b1a534264e30d2af6300675226e198d7dc9b1 # Parent 964677af4a3c8e291d2f44a26b4e39e202904769 Apply JDK-8073670 diff -r 964677af4a3c -r 107b1a534264 src/share/vm/opto/type.cpp --- a/src/share/vm/opto/type.cpp Tue Jun 16 18:19:03 2015 +0200 +++ b/src/share/vm/opto/type.cpp Tue Jun 16 11:55:35 2015 +0200 @@ -1092,8 +1092,10 @@ bool TypeD::eq( const Type *t ) const { if( g_isnan(_d) || g_isnan(t->getd()) ) { - // One or both are NANs. If both are NANs return true, else false. - return (g_isnan(_d) && g_isnan(t->getd())); + // it is important, when two different NaNs are used in one method, the NaNs are treated + // as different NaNs (as C1 does) + jdouble td = t->getd(); + return *((jlong*)(&_d)) == *(jlong*)(&td); } if (_d == t->getd()) { // (NaN is impossible at this point, since it is not equal even to itself)