aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1997-12-11 09:26:05 -0700
committerJeff Law <law@gcc.gnu.org>1997-12-11 09:26:05 -0700
commitb472527b0fdc204489ee647a6752b29b1291317a (patch)
tree14ba3dfecebffb68f2afc7348224d403c74620f6 /gcc/fold-const.c
parentc4ae3f91a2e59633859532b4e2f62b210f23b3bf (diff)
downloadgcc-b472527b0fdc204489ee647a6752b29b1291317a.zip
gcc-b472527b0fdc204489ee647a6752b29b1291317a.tar.gz
gcc-b472527b0fdc204489ee647a6752b29b1291317a.tar.bz2
Another handful of gcc-2.8 changes (will it ever go out the door?).
See ChangeLog.11 for details. From-SVN: r17040
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0bc8226..65a6d85 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1511,13 +1511,15 @@ fold_convert (t, arg1)
/* Indicate an overflow if (1) ARG1 already overflowed,
or (2) force_fit_type indicates an overflow.
Tell force_fit_type that an overflow has already occurred
- if ARG1 is a too-large unsigned value and T is signed. */
+ if ARG1 is a too-large unsigned value and T is signed.
+ But don't indicate an overflow if converting a pointer. */
TREE_OVERFLOW (t)
= (TREE_OVERFLOW (arg1)
- | force_fit_type (t,
- (TREE_INT_CST_HIGH (arg1) < 0
- & (TREE_UNSIGNED (type)
- < TREE_UNSIGNED (TREE_TYPE (arg1))))));
+ || (force_fit_type (t,
+ (TREE_INT_CST_HIGH (arg1) < 0
+ & (TREE_UNSIGNED (type)
+ < TREE_UNSIGNED (TREE_TYPE (arg1)))))
+ && TREE_CODE (TREE_TYPE (arg1)) != POINTER_TYPE));
TREE_CONSTANT_OVERFLOW (t)
= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg1);
}