aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-01-23 23:36:18 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-01-23 23:36:18 -0800
commitf3077311c4fbead462e28f646910039165076cc3 (patch)
tree11e6c50d2f8635688147c231a54bb4d34f8163e8 /gcc/fold-const.c
parentddd69607433a8cd05cf50c524746bea197205b6d (diff)
downloadgcc-f3077311c4fbead462e28f646910039165076cc3.zip
gcc-f3077311c4fbead462e28f646910039165076cc3.tar.gz
gcc-f3077311c4fbead462e28f646910039165076cc3.tar.bz2
fold-const.c (fold): Change UINT_MAX test to check vs precision rather than TYPE_MAX_VALUE.
* 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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index dec382d..2f0d4ac 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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: