This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/30511] False array bound check causes gcc failed to boostrap



------- Comment #1 from mueller at gcc dot gnu dot org  2007-01-19 20:04 -------
this patch fixes / works around it. I don't like it yet, I'm trying to find a
better solution. 

--- tree-vrp.c  (revision 120953)
+++ tree-vrp.c  (working copy)
@@ -3583,6 +3583,25 @@ check_array_bounds (tree *tp, int *walk_
            *walk_subtree = FALSE;
            return NULL_TREE;
          }
+
+       /* Don't warn if the result ssa_name is used in another
+         binary expr.  */
+       if (TREE_CODE ((tree)data) == GIMPLE_MODIFY_STMT
+           && GIMPLE_STMT_OPERAND ((tree)data, 0)
+           && TREE_CODE (GIMPLE_STMT_OPERAND ((tree)data, 0)) == SSA_NAME)
+         {
+          imm_use_iterator iter;
+          tree lhs = GIMPLE_STMT_OPERAND ((tree)data, 0);
+          tree use;
+
+          FOR_EACH_IMM_USE_STMT (use, iter, lhs)
+            if (TREE_CODE (use) == GIMPLE_MODIFY_STMT
+                && BINARY_CLASS_P (GIMPLE_STMT_OPERAND (use, 1)))
+              *walk_subtree = FALSE;
+
+          if (*walk_subtree == FALSE)
+            return NULL_TREE;
+         }
        while (handled_component_p (t))
          {
            if (TREE_CODE (t) == ARRAY_REF)


-- 

mueller at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-19 20:04:36
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30511


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]