From: Richard Kenner Date: Wed, 9 Feb 1994 00:23:30 +0000 (-0500) Subject: (int_fits_type_p): Properly handle case of variable bounds for types. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=857d2849a1e2d7ddc2337dedcc66b8d3248f2027;p=gcc.git (int_fits_type_p): Properly handle case of variable bounds for types. From-SVN: r6508 --- diff --git a/gcc/tree.c b/gcc/tree.c index d363f8442ee..bd14895e186 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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