This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Bugfix to minor fold_convert bug
- To: gcc-patches at gcc dot gnu dot org
- Subject: Bugfix to minor fold_convert bug
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Fri, 23 Feb 01 16:09:24 EST
If the input has an overflow indication, the output must as well. So you
can't call size_int_type_wide. Applied to mainline and GCC 3.0 branch.
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.
*** fold-const.c 2001/02/23 12:28:07 1.149
--- fold-const.c 2001/02/23 19:27:31
*************** fold_convert (t, arg1)
*** 2023,2026 ****
--- 2023,2027 ----
size_int to pick up cached types to reduce duplicate nodes. */
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
+ && !TREE_CONSTANT_OVERFLOW (arg1)
&& compare_tree_int (arg1, 10000) < 0)
return size_int_type_wide (TREE_INT_CST_LOW (arg1), type);