OSDN Git Service

* tree.h (TREE_OVERFLOW): Make this flag/predicate specific to
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Dec 2005 04:40:05 +0000 (04:40 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Dec 2005 04:40:05 +0000 (04:40 +0000)
constant nodes, i.e. INTEGER_CST, REAL_CST, etc...
* tree-vrp.c (compare_values): Only check TREE_OVERFLOW for
integer constant comparisons.

ada/
* utils.c (max_size): Only test for TREE_OVERFLOW on INTEGER_CST
nodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107870 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/utils.c
gcc/tree-vrp.c
gcc/tree.h

index ea64c3b..a3c113a 100644 (file)
@@ -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>
index 9ce8223..74ebace 100644 (file)
@@ -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.
index 2bfafce..0e0153f 100644 (file)
@@ -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;
index af632e6..0797b5c 100644 (file)
@@ -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;
index eace8b4..2a1d6e2 100644 (file)
@@ -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.