fold-const.c (fold_widened_comparison): Make sure that we're passing an INTEGER_TYPE...
authorEric Christopher <echristo@redhat.com>
Tue, 30 Nov 2004 20:33:34 +0000 (20:33 +0000)
committerEric Christopher <echristo@gcc.gnu.org>
Tue, 30 Nov 2004 20:33:34 +0000 (20:33 +0000)
2004-11-30  Eric Christopher  <echristo@redhat.com>

* fold-const.c (fold_widened_comparison): Make sure that we're
passing an INTEGER_TYPE to int_fits_type_p.
(fold): Clean up comment.

From-SVN: r91539

gcc/ChangeLog
gcc/fold-const.c

index c3400465b3b05cb3dff0d1539e9105d84d74bd2e..1478dd4f96f8dadd5c960bdaeb38bdaab97bc0c4 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-30  Eric Christopher  <echristo@redhat.com>
+
+       * fold-const.c (fold_widened_comparison): Make sure that we're
+       passing an INTEGER_TYPE to int_fits_type_p.
+       (fold): Clean up comment.
+
 2004-11-30  Zack Weinberg  <zack@codesourcery.com>
 
        * mklibgcc.in: Correct calculation of libgcc_s_soname and
index 98b827eafdb5c2d053322c22d4bf0151e701935e..8ddb039c52f3d69b7b2a8bcfa0e722d602566bd6 100644 (file)
@@ -6000,6 +6000,7 @@ fold_widened_comparison (enum tree_code code, tree type, tree arg0, tree arg1)
        || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type))
       && (TREE_TYPE (arg1_unw) == shorter_type
          || (TREE_CODE (arg1_unw) == INTEGER_CST
+             && TREE_CODE (shorter_type) == INTEGER_TYPE
              && int_fits_type_p (arg1_unw, shorter_type))))
     return fold (build (code, type, arg0_unw,
                        fold_convert (shorter_type, arg1_unw)));
@@ -8428,9 +8429,8 @@ fold (tree expr)
       /* Comparisons with the highest or lowest possible integer of
         the specified size will have known values.
 
-        This is quite similar to fold_relational_hi_lo; however, my
-        attempts to share the code have been nothing but trouble.
-        I give up for now.  */
+        This is quite similar to fold_relational_hi_lo, however,
+        attempts to share the code have been nothing but trouble.  */
       {
        int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg1)));