fold-const.c (fold_convert): Don't call size_int_type_wide if input overflows.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Fri, 23 Feb 2001 21:05:41 +0000 (21:05 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 23 Feb 2001 21:05:41 +0000 (16:05 -0500)
* fold-const.c (fold_convert): Don't call size_int_type_wide if
input overflows.

From-SVN: r40012

gcc/ChangeLog
gcc/fold-const.c

index ddce687a3bba40276ffba4595cdbf743d7b37d9c..a89be706dc20d813a009b5b1397f67ea9459ae34 100644 (file)
@@ -1,5 +1,8 @@
 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.
 
        * varasm.c (output_constant): Recompute CODE after lang-specific fn.
index 99a602cd297f944e9a9b9b5c999072461e1ecffa..69b99206802d913737e8881dc1eb126a27dd6fe8 100644 (file)
@@ -2022,6 +2022,7 @@ fold_convert (t, arg1)
          /* If we are trying to make a sizetype for a small integer, use
             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);