From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25141 invoked by alias); 2 Oct 2007 18:44:20 -0000 Received: (qmail 25081 invoked by uid 48); 2 Oct 2007 18:44:09 -0000 Date: Tue, 02 Oct 2007 18:44:00 -0000 Message-ID: <20071002184409.25080.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/33512] Simple bitwise simplification missed In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00160.txt.bz2 ------- 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