aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-11 08:18:16 +0000
committerRichard Stallman <rms@gnu.org>1993-03-11 08:18:16 +0000
commit88ece8db619050933051cfd6ef3f42ea5eba16a1 (patch)
treea7090b7175ec38b11e3ffe34e6c7759678d77b33
parentdb27aeecc2d19d28f0349191b0cc3c98e1642129 (diff)
downloadgcc-88ece8db619050933051cfd6ef3f42ea5eba16a1.zip
gcc-88ece8db619050933051cfd6ef3f42ea5eba16a1.tar.gz
gcc-88ece8db619050933051cfd6ef3f42ea5eba16a1.tar.bz2
(const_binop): When evaluating a shift, ignore
overflows generated by force_fit_type. From-SVN: r3700
-rw-r--r--gcc/fold-const.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index fe9b72d..ec04f44 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1095,7 +1095,12 @@ const_binop (code, arg1, arg2, notrunc)
&low, &hi,
!uns);
t = build_int_2 (low, hi);
- break;
+ TREE_TYPE (t) = TREE_TYPE (arg1);
+ if (!notrunc)
+ force_fit_type (t, 0);
+ TREE_CONSTANT_OVERFLOW (t)
+ = TREE_CONSTANT_OVERFLOW (arg1) | TREE_CONSTANT_OVERFLOW (arg2);
+ return t;
case RROTATE_EXPR:
int2l = - int2l;