------- 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

Reply via email to