aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-02-07 17:24:37 +0000
committerRichard Stallman <rms@gnu.org>1993-02-07 17:24:37 +0000
commitef2bf0c061d67c26b877151cd1983dbe39393aef (patch)
tree7e9d292126501a37afde6bf13ce94cfe6169461a /gcc/fold-const.c
parent3ceb5ed36caa09099afa64291397c9ca9c5bc462 (diff)
downloadgcc-ef2bf0c061d67c26b877151cd1983dbe39393aef.zip
gcc-ef2bf0c061d67c26b877151cd1983dbe39393aef.tar.gz
gcc-ef2bf0c061d67c26b877151cd1983dbe39393aef.tar.bz2
(fold): Call force_fit_type with two parameters.
(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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6e683e2..5a7aa46 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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;