changeset 21984:107b1a534264

Apply JDK-8073670
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Tue, 16 Jun 2015 11:55:35 +0200
parents 964677af4a3c
children ba769b2ee8fa
files src/share/vm/opto/type.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)