aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-01-01 17:29:53 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-01-01 17:29:53 +0000
commit69618c4943a871cbb938196afa968158dc9b0d11 (patch)
tree3447dbc0a189bc7176a069693940e31527795ae7 /gcc/tree.c
parent7a4515d72da6e68f654f2d74a28f7b8acc9f157a (diff)
downloadgcc-69618c4943a871cbb938196afa968158dc9b0d11.zip
gcc-69618c4943a871cbb938196afa968158dc9b0d11.tar.gz
gcc-69618c4943a871cbb938196afa968158dc9b0d11.tar.bz2
tree.c (int_fits_type_p): Compare the result of force_fit_type with the original constant rather than...
* 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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index d81abb2..ca97e30 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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);
}
}