+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.
}
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))
}
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:
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: