[Bug rtl-optimization/33512] Simple bitwise simplification missed
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Oct 2 18:44:00 GMT 2007
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-10-02 18:44 -------
Mine for RTL level:
Index: simplify-rtx.c
===================================================================
--- simplify-rtx.c (revision 2035)
+++ simplify-rtx.c (revision 2036)
@@ -1885,6 +1885,18 @@ simplify_binary_operation_1 (enum rtx_co
return simplify_gen_unary (NOT, mode, tem, mode);
}
+ /* (and X (ior (not X) Y) -> (and X Y) */
+ if (GET_CODE (op1) == IOR
+ && GET_CODE (XEXP (op1, 0)) == NOT
+ && op0 == XEXP (XEXP (op1, 0), 0))
+ return simplify_gen_binary (AND, mode, op0, XEXP (op1, 1));
+
+ /* (and (ior (not X) Y) X) -> (and X Y) */
+ if (GET_CODE (op0) == IOR
+ && GET_CODE (XEXP (op0, 0)) == NOT
+ && op1 == XEXP (XEXP (op0, 0), 0))
+ return simplify_gen_binary (AND, mode, op1, XEXP (op0, 1));
+
tem = simplify_associative_operation (code, mode, op0, op1);
if (tem)
return tem;
--
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|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-02 18:44:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33512
More information about the Gcc-bugs
mailing list