(fold): Call force_fit_type with two parameters.
authorRichard Stallman <rms@gnu.org>
Sun, 7 Feb 1993 17:24:37 +0000 (17:24 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 7 Feb 1993 17:24:37 +0000 (17:24 +0000)
(force_fit_type): Don't examine the tree until
it is known to an INTEGER_CST.  If it isn't, just return.

From-SVN: r3434

gcc/fold-const.c

index 6e683e2e2012e7d079bbbe462c34c37b950cf90d..5a7aa46dc958286ab8fb9a1ea8acd0f54c37dcd8 100644 (file)
@@ -123,14 +123,19 @@ force_fit_type (t, overflow)
      tree t;
      int overflow;
 {
-  HOST_WIDE_INT low = TREE_INT_CST_LOW (t), high = TREE_INT_CST_HIGH (t);
-  register int prec = TYPE_PRECISION (TREE_TYPE (t));
+  HOST_WIDE_INT low, high;
+  register int prec;
 
   if (TREE_CODE (t) != INTEGER_CST)
-    abort ();
+    return overflow;
+
+  low = TREE_INT_CST_LOW (t);
+  high = TREE_INT_CST_HIGH (t);
 
   if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
     prec = POINTER_SIZE;
+  else
+    prec = TYPE_PRECISION (TREE_TYPE (t));
 
   /* First clear all bits that are beyond the type's precision.  */
 
@@ -3258,7 +3263,7 @@ fold (expr)
            {
              t = build_int_2 (TREE_STRING_POINTER (arg0)[i], 0);
              TREE_TYPE (t) = TREE_TYPE (TREE_TYPE (arg0));
-             force_fit_type (t);
+             force_fit_type (t, 0);
            }
        }
       return t;