aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-06-17 17:54:27 +0000
committerJeff Law <law@gcc.gnu.org>1998-06-17 11:54:27 -0600
commit7d12cee1f19f361979d95de783cd939472c61c99 (patch)
tree900d25b1198794ec9e744e8f9487702e15f0afe2 /gcc/fold-const.c
parentb74390dec9feec897787bf938721323c18f42092 (diff)
downloadgcc-7d12cee1f19f361979d95de783cd939472c61c99.zip
gcc-7d12cee1f19f361979d95de783cd939472c61c99.tar.gz
gcc-7d12cee1f19f361979d95de783cd939472c61c99.tar.bz2
* fold-const.c (make_range): Do not widen the type of the expression.
From-SVN: r20545
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b75da2e..73b0189 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2821,6 +2821,7 @@ make_range (exp, pin_p, plow, phigh)
{
enum tree_code code;
tree arg0, arg1, type = NULL_TREE;
+ tree orig_type = NULL_TREE;
int in_p, n_in_p;
tree low, high, n_low, n_high;
@@ -2958,6 +2959,11 @@ make_range (exp, pin_p, plow, phigh)
continue;
case NOP_EXPR: case NON_LVALUE_EXPR: case CONVERT_EXPR:
+ if (orig_type == NULL_TREE)
+ orig_type = type;
+ if (TYPE_PRECISION (type) > TYPE_PRECISION (orig_type))
+ break;
+
if (! INTEGRAL_TYPE_P (type)
|| (low != 0 && ! int_fits_type_p (low, type))
|| (high != 0 && ! int_fits_type_p (high, type)))