Commit dcffa15b by Richard Stallman

(int_fits_type_p): Negative ints never fit unsigned

types, and unsigned ints with top-bit-set never fit signed types.

From-SVN: r2126
parent e8375399
......@@ -3131,10 +3131,12 @@ int_fits_type_p (c, type)
{
if (TREE_UNSIGNED (type))
return (!INT_CST_LT_UNSIGNED (TYPE_MAX_VALUE (type), c)
&& !INT_CST_LT_UNSIGNED (c, TYPE_MIN_VALUE (type)));
&& !INT_CST_LT_UNSIGNED (c, TYPE_MIN_VALUE (type))
&& (TREE_INT_CST_HIGH (c) >= 0 || TREE_UNSIGNED (TREE_TYPE (c))));
else
return (!INT_CST_LT (TYPE_MAX_VALUE (type), c)
&& !INT_CST_LT (c, TYPE_MIN_VALUE (type)));
&& !INT_CST_LT (c, TYPE_MIN_VALUE (type))
&& (TREE_INT_CST_HIGH (c) >= 0 || !TREE_UNSIGNED (TREE_TYPE (c))));
}
/* Return the innermost context enclosing DECL that is
......
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