(fold_convert): Don't fold conversion if it would produce constant
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 22 Nov 1994 22:40:46 +0000 (17:40 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 22 Nov 1994 22:40:46 +0000 (17:40 -0500)
larger than we can support.

From-SVN: r8551

gcc/fold-const.c

index d286f278bd390f1e0ba755e87ebdae28ba5991aa..9b1a7b4775d274cab2b5531d2b845f79ee4ecaff 100644 (file)
@@ -1404,6 +1404,11 @@ fold_convert (t, arg1)
     {
       if (TREE_CODE (arg1) == INTEGER_CST)
        {
+         /* If we would build a constant wider than GCC supports,
+            leave the conversion unfolded.  */
+         if (TYPE_PRECISION (type) > 2 * HOST_BITS_PER_WIDE_INT)
+           return t;
+
          /* Given an integer constant, make new constant with new type,
             appropriately sign-extended or truncated.  */
          t = build_int_2 (TREE_INT_CST_LOW (arg1),