Commit a8765ae7 by Richard Kenner Committed by Richard Kenner

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
parent aea9695c
Tue Jan 22 06:26:33 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Tue Jan 22 06:26:33 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree.c (int_fits_type_p): If bounds of a subtype are variable, see
if fits in bounds of base type.
* dwarf2out.c (equate_decl_number_to_die): Add "int" to decls. * dwarf2out.c (equate_decl_number_to_die): Add "int" to decls.
(loc_descriptor_from_tree, case CALL_EXPR, case ADDR_EXPR): New. (loc_descriptor_from_tree, case CALL_EXPR, case ADDR_EXPR): New.
(add_bound_info, default): If can't find a context, make a (add_bound_info, default): If can't find a context, make a
......
...@@ -4245,7 +4245,8 @@ int_fits_type_p (c, type) ...@@ -4245,7 +4245,8 @@ int_fits_type_p (c, type)
tree c, type; tree c, type;
{ {
/* If the bounds of the type are integers, we can check ourselves. /* 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 if (TYPE_MAX_VALUE (type) != NULL_TREE
&& TYPE_MIN_VALUE (type) != NULL_TREE && TYPE_MIN_VALUE (type) != NULL_TREE
&& TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
...@@ -4264,6 +4265,8 @@ int_fits_type_p (c, type) ...@@ -4264,6 +4265,8 @@ int_fits_type_p (c, type)
&& ! (TREE_INT_CST_HIGH (c) < 0 && ! (TREE_INT_CST_HIGH (c) < 0
&& TREE_UNSIGNED (TREE_TYPE (c)))); && 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 else
{ {
c = copy_node (c); c = copy_node (c);
......
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