OSDN Git Service

* fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Oct 2000 13:35:07 +0000 (13:35 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Oct 2000 13:35:07 +0000 (13:35 +0000)
negation in proper type.a

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36726 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c

index 06ed5d3..540f54a 100644 (file)
@@ -1,3 +1,8 @@
+Thu Oct  5 09:31:31 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform
+       negation in proper type.a
+
 2000-10-04  Richard Henderson  <rth@cygnus.com>
 
        * configure.in (enable-shared): New.
index ecc7c32..6908d71 100644 (file)
@@ -5576,7 +5576,7 @@ fold (expr)
       if (! FLOAT_TYPE_P (type))
        {
          if (! wins && integer_zerop (arg0))
-           return convert (type, negate_expr (arg1));
+           return negate_expr (convert (type, arg1));
          if (integer_zerop (arg1))
            return non_lvalue (convert (type, arg0));
 
@@ -5599,7 +5599,7 @@ fold (expr)
        {
          /* Except with IEEE floating point, 0-x equals -x.  */
          if (! wins && real_zerop (arg0))
-           return convert (type, negate_expr (arg1));
+           return negate_expr (convert (type, arg1));
          /* Except with IEEE floating point, x-0 equals x.  */
          if (real_zerop (arg1))
            return non_lvalue (convert (type, arg0));
@@ -6888,7 +6888,12 @@ fold (expr)
              {
              case EQ_EXPR:
                return
-                 pedantic_non_lvalue (convert (type, negate_expr (arg1)));
+                 pedantic_non_lvalue
+                   (convert (type,
+                             negate_expr
+                             (convert (TREE_TYPE (TREE_OPERAND (t, 1)),
+                                       arg1))));
+
              case NE_EXPR:
                return pedantic_non_lvalue (convert (type, arg1));
              case GE_EXPR: