fold-const.c (make_range): If orig_type is unset, set it as soon as we know the type.
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 24 Mar 1999 22:48:37 +0000 (22:48 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 24 Mar 1999 22:48:37 +0000 (15:48 -0700)
        * fold-const.c (make_range): If orig_type is unset, set it as soon
        as we know the type.  Remove now unnecessary set of orig_type for
        conversions.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r25959

gcc/ChangeLog
gcc/fold-const.c

index 43c57969f536751760fc50d664d16cefdf8921f7..36dee71a4da1bc31c12e9953022c7822482e355b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Mar 23 15:45:25 1999  Richard Earnshaw (rearnsha@arm.com)
+                         Jeff Law <law@cygnus.com>
+
+       * fold-const.c (make_range): If orig_type is unset, set it as soon
+       as we know the type.  Remove now unnecessary set of orig_type for
+       conversions.
+
 Wed Mar 24 23:27:25 1999  Mark Elbrecht  <snowball3@usa.net.
 
        * i386/djgpp.h: Fix typo.
index 4faac0c649cb6069a079239518f966132ff5e2ba..1e7bd195ab492fe6a149dd3606e5d843921da5bd 100644 (file)
@@ -3140,6 +3140,11 @@ make_range (exp, pin_p, plow, phigh)
            arg1 = TREE_OPERAND (exp, 1);
        }
 
+      /* Set ORIG_TYPE as soon as TYPE is non-null so that we do not
+        lose a cast by accident.  */
+      if (type != NULL_TREE && orig_type == NULL_TREE)
+       orig_type = type;
+
       switch (code)
        {
        case TRUTH_NOT_EXPR:
@@ -3258,8 +3263,6 @@ 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;