hotspot/src/share/vm/opto/divnode.cpp
changeset 1436 6869d58f4f58
parent 1432 44f076e3d2a4
child 2031 24e034f56dcb
--- a/hotspot/src/share/vm/opto/divnode.cpp	Fri Oct 10 09:47:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/divnode.cpp	Tue Oct 14 06:58:58 2008 -0700
@@ -710,11 +710,18 @@
   if( t2 == TypeD::ONE )
     return t1;
 
-  // If divisor is a constant and not zero, divide them numbers
-  if( t1->base() == Type::DoubleCon &&
-      t2->base() == Type::DoubleCon &&
-      t2->getd() != 0.0 ) // could be negative zero
-    return TypeD::make( t1->getd()/t2->getd() );
+#if defined(IA32)
+  if (!phase->C->method()->is_strict())
+    // Can't trust native compilers to properly fold strict double
+    // division with round-to-zero on this platform.
+#endif
+    {
+      // If divisor is a constant and not zero, divide them numbers
+      if( t1->base() == Type::DoubleCon &&
+          t2->base() == Type::DoubleCon &&
+          t2->getd() != 0.0 ) // could be negative zero
+        return TypeD::make( t1->getd()/t2->getd() );
+    }
 
   // If the dividend is a constant zero
   // Note: if t1 and t2 are zero then result is NaN (JVMS page 213)