fold-const.c (fold): Change UINT_MAX test to check vs precision rather than TYPE_MAX_...
authorRichard Henderson <rth@redhat.com>
Thu, 24 Jan 2002 07:36:18 +0000 (23:36 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 24 Jan 2002 07:36:18 +0000 (23:36 -0800)
        * fold-const.c (fold): Change UINT_MAX test to check vs precision
        rather than TYPE_MAX_VALUE.  Fix indentation and a bogus negation.

From-SVN: r49174

gcc/ChangeLog
gcc/fold-const.c

index c181bd70ed21932179ac00c6e7de19d4cc018b14..de4b9fc0ff27136b51e3ac410c178e2c58360ec5 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-23  Richard Henderson  <rth@redhat.com>
+
+       * fold-const.c (fold): Change UINT_MAX test to check vs precision
+       rather than TYPE_MAX_VALUE.  Fix indentation and a bogus negation.
+
 2002-01-24  Alexandre Oliva  <aoliva@redhat.com>
 
        * config/sh/sh.md (symGOT_load, sym2GOT, sym2GOTOFF): New expands.
index dec382d854e3c5275c5514ca98dd97642d3a8183..2f0d4ace1c1f84d3fd7e65e8a9a84c91bfd632c5 100644 (file)
@@ -6703,7 +6703,7 @@ fold (expr)
                }
 
            else if (TREE_INT_CST_HIGH (arg1) == -1
-                    && (TREE_INT_CST_LOW (arg1)
+                    && (TREE_INT_CST_LOW (arg1)
                         == ((unsigned HOST_WIDE_INT) 1 << (width - 1)))
                     && ! TREE_UNSIGNED (TREE_TYPE (arg1)))
              switch (TREE_CODE (t))
@@ -6729,12 +6729,11 @@ fold (expr)
                }
 
            else if (TREE_INT_CST_HIGH (arg1) == 0
-                     && (TREE_INT_CST_LOW (arg1)
-                         == ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
-                     && TREE_UNSIGNED (TREE_TYPE (arg1))
-                        /* signed_type does not work on pointer types.  */
-                     && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
-
+                    && (TREE_INT_CST_LOW (arg1)
+                        == ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
+                    && TREE_UNSIGNED (TREE_TYPE (arg1))
+                    /* signed_type does not work on pointer types.  */
+                    && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
              switch (TREE_CODE (t))
                {
                case LE_EXPR:
@@ -6754,9 +6753,10 @@ fold (expr)
                  break;
                }
 
-            else if (TREE_UNSIGNED (TREE_TYPE (arg1))
-                     && tree_int_cst_equal (TYPE_MAX_VALUE (TREE_TYPE (arg1)),
-                                            arg1))
+            else if (TREE_INT_CST_HIGH (arg1) == 0
+                    && (TREE_INT_CST_LOW (arg1)
+                        == ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1)
+                    && TREE_UNSIGNED (TREE_TYPE (arg1)))
               switch (TREE_CODE (t))
                 {
                 case GT_EXPR: