diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-08 19:23:30 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-08 19:23:30 -0500 |
commit | 857d2849a1e2d7ddc2337dedcc66b8d3248f2027 (patch) | |
tree | 352d7ae59f5f24278a25ccc6e44fbd93765db92e /gcc | |
parent | 2628709d5a63f2aab529662edbfa0f6d07d7e056 (diff) | |
download | gcc-857d2849a1e2d7ddc2337dedcc66b8d3248f2027.zip gcc-857d2849a1e2d7ddc2337dedcc66b8d3248f2027.tar.gz gcc-857d2849a1e2d7ddc2337dedcc66b8d3248f2027.tar.bz2 |
(int_fits_type_p): Properly handle case of variable bounds for types.
From-SVN: r6508
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 |