Commit 857d2849 by Richard Kenner

(int_fits_type_p): Properly handle case of variable bounds for types.

From-SVN: r6508
parent 2628709d
......@@ -3606,13 +3606,15 @@ int_fits_type_p (c, type)
tree 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))
&& (TREE_INT_CST_HIGH (c) >= 0 || TREE_UNSIGNED (TREE_TYPE (c))));
return (! (TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
&& INT_CST_LT_UNSIGNED (TYPE_MAX_VALUE (type), c))
&& ! (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
&& INT_CST_LT_UNSIGNED (c, TYPE_MIN_VALUE (type))));
else
return (!INT_CST_LT (TYPE_MAX_VALUE (type), c)
&& !INT_CST_LT (c, TYPE_MIN_VALUE (type))
&& (TREE_INT_CST_HIGH (c) >= 0 || !TREE_UNSIGNED (TREE_TYPE (c))));
return (! (TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
&& INT_CST_LT (TYPE_MAX_VALUE (type), c))
&& ! (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
&& INT_CST_LT (c, TYPE_MIN_VALUE (type))));
}
/* 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