*** empty log message ***
authorRichard Stallman <rms@gnu.org>
Sun, 17 May 1992 07:07:44 +0000 (07:07 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 17 May 1992 07:07:44 +0000 (07:07 +0000)
From-SVN: r999

gcc/cse.c
gcc/fold-const.c

index 6f8154b72fccda6b1998446b476002537b522023..692eec5f4c4f0c0741654f0eb490827dd647808d 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2948,12 +2948,12 @@ simplify_unary_operation (code, mode, op, op_mode)
       return gen_rtx (CONST_INT, VOIDmode, val);
     }
 #endif
-  else if (GET_MODE_CLASS (mode) == MODE_INT
-          || TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT)
+  /* This was formerly used only for non-IEEE float.
+     eggert@twinsun.com says it is safe for IEEE also.  */
+  else
     {
       /* There are some simplifications we can do even if the operands
-        aren't constant, but they don't apply to floating-point
-        unless not IEEE.  */
+        aren't constant.  */
       switch (code)
        {
        case NEG:
@@ -2979,8 +2979,6 @@ simplify_unary_operation (code, mode, op, op_mode)
 
       return 0;
     }
-  else
-    return 0;
 }
 \f
 /* Simplify a binary operation CODE with result mode MODE, operating on OP0
index 029f25cde241728f744c73fabcb3a8688e077cd4..dd269861d556f34b930f56c3902b47a650cb46ea 100644 (file)
@@ -3007,15 +3007,17 @@ fold (expr)
          /* Except with IEEE floating point, x-0 equals x.  */
          if (real_zerop (arg1))
            return non_lvalue (convert (type, arg0));
-       }
-      /* Fold &x - &x.  This can happen from &x.foo - &x. 
-        Note that can't be done for certain floats even in non-IEEE formats.
-        Also note that operand_equal_p is always false is an operand
-        is volatile.  */
 
-      if (operand_equal_p (arg0, arg1,
-                          TREE_CODE (type) == REAL_TYPE))
-       return convert (type, integer_zero_node);
+         /* Fold &x - &x.  This can happen from &x.foo - &x. 
+            This is unsafe for certain floats even in non-IEEE formats.
+            In IEEE, it is unsafe because it does wrong for NaNs.
+            Also note that operand_equal_p is always false is an operand
+            is volatile.  */
+
+         if (operand_equal_p (arg0, arg1,
+                              TREE_CODE (type) == REAL_TYPE))
+           return convert (type, integer_zero_node);
+       }
       goto associate;
 
     case MULT_EXPR: