OSDN Git Service

* fold-const.c (fold): Change UINT_MAX test to check vs precision
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2002 07:36:18 +0000 (07:36 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2002 07:36:18 +0000 (07:36 +0000)
        rather than TYPE_MAX_VALUE.  Fix indentation and a bogus negation.

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

gcc/ChangeLog
gcc/fold-const.c

index c181bd7..de4b9fc 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 dec382d..2f0d4ac 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: