Commit f3077311 by Richard Henderson Committed by Richard Henderson

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
parent ddd69607
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> 2002-01-24 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.md (symGOT_load, sym2GOT, sym2GOTOFF): New expands. * config/sh/sh.md (symGOT_load, sym2GOT, sym2GOTOFF): New expands.
......
...@@ -6703,7 +6703,7 @@ fold (expr) ...@@ -6703,7 +6703,7 @@ fold (expr)
} }
else if (TREE_INT_CST_HIGH (arg1) == -1 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))) == ((unsigned HOST_WIDE_INT) 1 << (width - 1)))
&& ! TREE_UNSIGNED (TREE_TYPE (arg1))) && ! TREE_UNSIGNED (TREE_TYPE (arg1)))
switch (TREE_CODE (t)) switch (TREE_CODE (t))
...@@ -6729,12 +6729,11 @@ fold (expr) ...@@ -6729,12 +6729,11 @@ fold (expr)
} }
else if (TREE_INT_CST_HIGH (arg1) == 0 else if (TREE_INT_CST_HIGH (arg1) == 0
&& (TREE_INT_CST_LOW (arg1) && (TREE_INT_CST_LOW (arg1)
== ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1) == ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
&& TREE_UNSIGNED (TREE_TYPE (arg1)) && TREE_UNSIGNED (TREE_TYPE (arg1))
/* signed_type does not work on pointer types. */ /* signed_type does not work on pointer types. */
&& INTEGRAL_TYPE_P (TREE_TYPE (arg1))) && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case LE_EXPR: case LE_EXPR:
...@@ -6754,9 +6753,10 @@ fold (expr) ...@@ -6754,9 +6753,10 @@ fold (expr)
break; break;
} }
else if (TREE_UNSIGNED (TREE_TYPE (arg1)) else if (TREE_INT_CST_HIGH (arg1) == 0
&& tree_int_cst_equal (TYPE_MAX_VALUE (TREE_TYPE (arg1)), && (TREE_INT_CST_LOW (arg1)
arg1)) == ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1)
&& TREE_UNSIGNED (TREE_TYPE (arg1)))
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case GT_EXPR: case GT_EXPR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment