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:20:16 -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 #6 from pinskia at gcc dot gnu dot org 2007-07-18 20:20 -------
Here is a patch which fixes this specific ICE:
Index: fold-const.c
===================================================================
--- fold-const.c (revision 126721)
+++ fold-const.c (working copy)
@@ -9723,15 +9723,19 @@
&& TREE_CODE (arg1) == BIT_AND_EXPR)
{
if (operand_equal_p (arg0, TREE_OPERAND (arg1, 1), 0))
- return fold_build2 (BIT_AND_EXPR, type,
- fold_build1 (BIT_NOT_EXPR, type,
- TREE_OPERAND (arg1, 0)),
+ {
+ tree arg10 = fold_convert (type, TREE_OPERAND (arg1, 0));
+ return fold_build2 (BIT_AND_EXPR, type,
+ fold_build1 (BIT_NOT_EXPR, type, arg10),
arg0);
+ }
if (operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0))
- return fold_build2 (BIT_AND_EXPR, type,
- fold_build1 (BIT_NOT_EXPR, type,
- TREE_OPERAND (arg1, 1)),
+ {
+ tree arg11 = fold_convert (type, TREE_OPERAND (arg1, 1));
+ return fold_build2 (BIT_AND_EXPR, type,
+ fold_build1 (BIT_NOT_EXPR, type, arg11),
arg0);
+ }
}
/* Fold (A & ~B) - (A & B) into (A ^ B) - B, where B is
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32780