Commit ac50176d by Richard Kenner Committed by Richard Kenner

fold-const.c (fold_convert): Don't call size_int_type_wide if input overflows.

	* fold-const.c (fold_convert): Don't call size_int_type_wide if
	input overflows.

From-SVN: r40012
parent 9b58f739
Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* fold-const.c (fold_convert): Don't call size_int_type_wide if
input overflows.
* c-decl.c (set_block): Set NAMES and BLOCKS from BLOCK. * c-decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
* varasm.c (output_constant): Recompute CODE after lang-specific fn. * varasm.c (output_constant): Recompute CODE after lang-specific fn.
......
...@@ -2022,6 +2022,7 @@ fold_convert (t, arg1) ...@@ -2022,6 +2022,7 @@ fold_convert (t, arg1)
/* If we are trying to make a sizetype for a small integer, use /* If we are trying to make a sizetype for a small integer, use
size_int to pick up cached types to reduce duplicate nodes. */ size_int to pick up cached types to reduce duplicate nodes. */
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type) if (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
&& !TREE_CONSTANT_OVERFLOW (arg1)
&& compare_tree_int (arg1, 10000) < 0) && compare_tree_int (arg1, 10000) < 0)
return size_int_type_wide (TREE_INT_CST_LOW (arg1), type); return size_int_type_wide (TREE_INT_CST_LOW (arg1), type);
......
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