This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32780] [4.3 Regression] ICE in extract_range_from_binary_expr, at tree-vrp.c:1793 at -O2 or higher
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2007 20:15:41 -0000
- Subject: [Bug middle-end/32780] [4.3 Regression] ICE in extract_range_from_binary_expr, at tree-vrp.c:1793 at -O2 or higher
- References: <bug-32780-5606@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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