fold-const.c (fold, [...]): Always return tree of proper type.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sun, 26 Nov 2000 15:04:25 +0000 (15:04 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 26 Nov 2000 15:04:25 +0000 (10:04 -0500)
* fold-const.c (fold, case CONVERT_EXPR): Always return tree of
proper type.

From-SVN: r37757

gcc/ChangeLog
gcc/fold-const.c

index 0e8492d84d6203113e1b0fb55a5d5ed1d3d460d3..61f696cf3abc628c83c408e93fd6d3de44311984 100644 (file)
@@ -1,3 +1,8 @@
+Sun Nov 26 10:02:37 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * fold-const.c (fold, case CONVERT_EXPR): Always return tree of
+       proper type.
+
 2000-11-26  Neil Booth  <neilb@earthling.net>
 
         * Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib.
index aaff05f4d757089f4cca5c004a83e9ff7cccc8ce..d8131faf226c66f982183f47379492dadcfb4be7 100644 (file)
@@ -5103,7 +5103,7 @@ fold (expr)
          if (TYPE_MAIN_VARIANT (inside_type) == TYPE_MAIN_VARIANT (final_type)
              && ((inter_int && final_int) || (inter_float && final_float))
              && inter_prec >= final_prec)
-           return TREE_OPERAND (TREE_OPERAND (t, 0), 0);
+           return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0));
 
          /* Likewise, if the intermediate and final types are either both
             float or both integer, we don't need the middle conversion if