aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/utils.c13
-rw-r--r--gcc/tree-vrp.c12
-rw-r--r--gcc/tree.h7
5 files changed, 31 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea64c3b..a3c113a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-01 Roger Sayle <roger@eyesopen.com>
+
+ * tree.h (TREE_OVERFLOW): Make this flag/predicate specific to
+ constant nodes, i.e. INTEGER_CST, REAL_CST, etc...
+ * tree-vrp.c (compare_values): Only check TREE_OVERFLOW for
+ integer constant comparisons.
+
2005-12-02 Jon Grimm <jgrimm2@us.ibm.com>
Janis Johnson <janis187@us.ibm.com>
David Edelsohn <dje@watson.ibm.com>
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9ce8223..74ebace 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-01 Roger Sayle <roger@eyesopen.com>
+
+ * utils.c (max_size): Only test for TREE_OVERFLOW on INTEGER_CST
+ nodes.
+
2005-11-23 Laurent GUERBY <laurent@guerby.net>
* mlib-prj.adb (Build_Library): Initialize Delete.
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 2bfafce..0e0153f 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2031,12 +2031,19 @@ max_size (tree exp, bool max_p)
Likewise, handle a MINUS_EXPR or PLUS_EXPR with the LHS
overflowing or the maximum possible value and the RHS
a variable. */
- if (max_p && code == MIN_EXPR && TREE_OVERFLOW (rhs))
+ if (max_p
+ && code == MIN_EXPR
+ && TREE_CODE (rhs) == INTEGER_CST
+ && TREE_OVERFLOW (rhs))
return lhs;
- else if (max_p && code == MIN_EXPR && TREE_OVERFLOW (lhs))
+ else if (max_p
+ && code == MIN_EXPR
+ && TREE_CODE (lhs) == INTEGER_CST
+ && TREE_OVERFLOW (lhs))
return rhs;
else if ((code == MINUS_EXPR || code == PLUS_EXPR)
- && ((TREE_CONSTANT (lhs) && TREE_OVERFLOW (lhs))
+ && ((TREE_CODE (lhs) == INTEGER_CST
+ && TREE_OVERFLOW (lhs))
|| operand_equal_p (lhs, TYPE_MAX_VALUE (type), 0))
&& !TREE_CONSTANT (rhs))
return lhs;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index af632e6..0797b5c 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -528,12 +528,14 @@ compare_values (tree val1, tree val2)
if (!is_gimple_min_invariant (val1) || !is_gimple_min_invariant (val2))
return -2;
- /* We cannot compare overflowed values. */
- if (TREE_OVERFLOW (val1) || TREE_OVERFLOW (val2))
- return -2;
-
if (!POINTER_TYPE_P (TREE_TYPE (val1)))
- return tree_int_cst_compare (val1, val2);
+ {
+ /* We cannot compare overflowed values. */
+ if (TREE_OVERFLOW (val1) || TREE_OVERFLOW (val2))
+ return -2;
+
+ return tree_int_cst_compare (val1, val2);
+ }
else
{
tree t;
diff --git a/gcc/tree.h b/gcc/tree.h
index eace8b4..2a1d6e2 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -335,7 +335,6 @@ struct tree_common GTY(())
TREE_OVERFLOW in
INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
- ??? and other expressions?
TREE_PUBLIC in
VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE
ASM_VOLATILE_P in
@@ -907,11 +906,9 @@ extern void tree_operand_check_failed (int, enum tree_code,
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
there was an overflow in folding, and no warning has been issued
for this subexpression. TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
- but not vice versa.
+ but not vice versa. */
- ??? Apparently, lots of code assumes this is defined in all
- expressions. */
-#define TREE_OVERFLOW(NODE) ((NODE)->common.public_flag)
+#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.public_flag)
/* In a VAR_DECL or FUNCTION_DECL,
nonzero means name is to be accessible from outside this module.