]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (int_fits_type_p): Compare the result of force_fit_type with the original...
authorRoger Sayle <roger@eyesopen.com>
Sat, 1 Jan 2005 17:29:53 +0000 (17:29 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 1 Jan 2005 17:29:53 +0000 (17:29 +0000)
* tree.c (int_fits_type_p): Compare the result of force_fit_type
with the original constant rather than require TREE_OVERFLOW.

From-SVN: r92786

gcc/ChangeLog
gcc/tree.c

index 178b181d5419ffea63bc2b9795dd8b7c2d6e05af..159941cec258c82ccf1374360376cfccbb4823f9 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-01  Roger Sayle  <roger@eyesopen.com>
+
+       * tree.c (int_fits_type_p): Compare the result of force_fit_type
+       with the original constant rather than require TREE_OVERFLOW.
+
 2005-01-01  Steven Bosscher  <stevenb@suse.de>
 
        PR middle-end/17544
index d81abb2df9d1f16a8b501406c7fc6aa4bb08ca30..ca97e30351e4b89d8bdc9d388bc6e5086b7f23d5 100644 (file)
@@ -1,6 +1,6 @@
 /* Language-independent node constructors for parse phase of GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -4926,10 +4926,11 @@ int_fits_type_p (tree c, tree type)
   /* Or to force_fit_type, if nothing else.  */
   else
     {
-      c = copy_node (c);
-      TREE_TYPE (c) = type;
-      c = force_fit_type (c, -1, false, false);
-      return !TREE_OVERFLOW (c);
+      tree n = copy_node (c);
+      TREE_TYPE (n) = type;
+      n = force_fit_type (n, -1, false, false);
+      return TREE_INT_CST_HIGH (n) == TREE_INT_CST_HIGH (c)
+             && TREE_INT_CST_LOW (n) == TREE_INT_CST_LOW (c);
     }
 }