* fold-const.c (make_range): Do not widen the type of the expression.
authorJeffrey A Law <law@cygnus.com>
Wed, 17 Jun 1998 17:54:27 +0000 (17:54 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 17 Jun 1998 17:54:27 +0000 (11:54 -0600)
From-SVN: r20545

gcc/ChangeLog
gcc/fold-const.c

index d8b9febc64bdcafa2dd0148be4b14b5492575adb..e271a4752c6edf7b75a96c84b23ebdb51d5cc70b 100644 (file)
@@ -65,6 +65,8 @@ Wed Jun 17 15:57:48 EDT 1998  Andrew MacLeod  (amacleod@cygnus.com)
 
 Wed Jun 17 08:38:13 1998  Jeffrey A Law  (law@cygnus.com)
 
+       * fold-const.c (make_range): Do not widen the type of the expression.
+
        * expr.c (check_max_integer_computation_mode): New function.
        (expand_expr): Avoid integer computations in modes wider than
        MAX_INTEGER_COMPUTATION_MODE.
index b75da2e77fd10e6d4f78e9d4c5db40e9b02e0def..73b018924650e6b53c5e5733571ee530fd3ed479 100644 (file)
@@ -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)))