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 middle-end/32780] [4.3 Regression] ICE in extract_range_from_binary_expr, at tree-vrp.c:1793 at -O2 or higher



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-07-18 20:15 -------
This patch adds extra testing (though not tested fully) to catch this earlier:
Index: tree.c
===================================================================
--- tree.c      (revision 126721)
+++ tree.c      (working copy)
@@ -3072,8 +3072,12 @@
   gcc_assert (code != GIMPLE_MODIFY_STMT);
 #endif

-  if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR)
-      && arg0 && arg1 && tt && POINTER_TYPE_P (tt))
+  if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR
+       || code == BIT_AND_EXPR)
+      && arg0 && arg1 && tt
+      && (POINTER_TYPE_P (tt)
+         || POINTER_TYPE_P (TREE_TYPE (arg1))
+         || POINTER_TYPE_P (TREE_TYPE (arg0))))
     gcc_assert (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) ==
INTEGER_CST);

   if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt)


-- 


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


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