aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2007-01-13 05:39:57 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2007-01-13 05:39:57 +0000
commit8bcd6380d1a8cdd5de8095599ea452885b6d3959 (patch)
treed4290671d093f8e648c9da2482bcce6088ee57b7 /gcc
parentd95787e646b7b5f027d7f241707aa0f297949792 (diff)
downloadgcc-8bcd6380d1a8cdd5de8095599ea452885b6d3959.zip
gcc-8bcd6380d1a8cdd5de8095599ea452885b6d3959.tar.gz
gcc-8bcd6380d1a8cdd5de8095599ea452885b6d3959.tar.bz2
c-typeck.c (null_pointer_constant_p): Replace use of TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
* c-typeck.c (null_pointer_constant_p): Replace use of TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW. (build_c_cast): Likewise. From-SVN: r120747
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-typeck.c19
2 files changed, 16 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 17baae3..fcaf921 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2007-01-12 Roger Sayle <roger@eyesopen.com>
+ * c-typeck.c (null_pointer_constant_p): Replace use of
+ TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
+ (build_c_cast): Likewise.
+
+2007-01-12 Roger Sayle <roger@eyesopen.com>
+
* tree.h (force_fit_type_double): Remove unused final argument.
* c-common.c (constant_expression_warning): Replace use of
TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 50db7d4..66b109e 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C compiler.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
@@ -117,7 +117,7 @@ null_pointer_constant_p (tree expr)
yet available everywhere required. */
tree type = TREE_TYPE (expr);
return (TREE_CODE (expr) == INTEGER_CST
- && !TREE_CONSTANT_OVERFLOW (expr)
+ && !TREE_OVERFLOW (expr)
&& integer_zerop (expr)
&& (INTEGRAL_TYPE_P (type)
|| (TREE_CODE (type) == POINTER_TYPE
@@ -3588,15 +3588,16 @@ build_c_cast (tree type, tree expr)
/* Ignore any integer overflow caused by the cast. */
if (TREE_CODE (value) == INTEGER_CST)
{
- if (CONSTANT_CLASS_P (ovalue)
- && (TREE_OVERFLOW (ovalue) || TREE_CONSTANT_OVERFLOW (ovalue)))
+ if (CONSTANT_CLASS_P (ovalue) && TREE_OVERFLOW (ovalue))
{
- /* Avoid clobbering a shared constant. */
- value = copy_node (value);
- TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
- TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue);
+ if (!TREE_OVERFLOW (value))
+ {
+ /* Avoid clobbering a shared constant. */
+ value = copy_node (value);
+ TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
+ }
}
- else if (TREE_OVERFLOW (value) || TREE_CONSTANT_OVERFLOW (value))
+ else if (TREE_OVERFLOW (value))
/* Reset VALUE's overflow flags, ensuring constant sharing. */
value = build_int_cst_wide (TREE_TYPE (value),
TREE_INT_CST_LOW (value),