aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-08 19:23:30 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-08 19:23:30 -0500
commit857d2849a1e2d7ddc2337dedcc66b8d3248f2027 (patch)
tree352d7ae59f5f24278a25ccc6e44fbd93765db92e /gcc
parent2628709d5a63f2aab529662edbfa0f6d07d7e056 (diff)
downloadgcc-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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index d363f84..bd14895 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