diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2002-01-22 12:01:54 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2002-01-22 07:01:54 -0500 |
commit | a8765ae7a090cfbc12b41f643938fdd17a3c0dec (patch) | |
tree | d0b4885e9a5770fecec22272ef14c5026f470e13 /gcc/tree.c | |
parent | aea9695ca5c18f6aba6d429b0a593411f37b5c0f (diff) | |
download | gcc-a8765ae7a090cfbc12b41f643938fdd17a3c0dec.zip gcc-a8765ae7a090cfbc12b41f643938fdd17a3c0dec.tar.gz gcc-a8765ae7a090cfbc12b41f643938fdd17a3c0dec.tar.bz2 |
tree.c (int_fits_type_p): If bounds of a subtype are variable, see if fits in bounds of base type.
* tree.c (int_fits_type_p): If bounds of a subtype are variable, see
if fits in bounds of base type.
From-SVN: r49070
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4245,7 +4245,8 @@ int_fits_type_p (c, type) tree c, type; { /* If the bounds of the type are integers, we can check ourselves. - Otherwise,. use force_fit_type, which checks against the precision. */ + If not, but this type is a subtype, try checking against that. + Otherwise, use force_fit_type, which checks against the precision. */ if (TYPE_MAX_VALUE (type) != NULL_TREE && TYPE_MIN_VALUE (type) != NULL_TREE && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST @@ -4264,6 +4265,8 @@ int_fits_type_p (c, type) && ! (TREE_INT_CST_HIGH (c) < 0 && TREE_UNSIGNED (TREE_TYPE (c)))); } + else if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type) != 0) + return int_fits_type_p (c, TREE_TYPE (type)); else { c = copy_node (c); |