From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4708 invoked by alias); 21 Mar 2007 18:28:47 -0000 Received: (qmail 4577 invoked by uid 48); 21 Mar 2007 18:28:35 -0000 Date: Wed, 21 Mar 2007 18:28:00 -0000 Message-ID: <20070321182835.4576.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/31261] Missed tree optimizations: (8 - (x & 7)) & 7 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "trt at acm 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-03/txt/msg02079.txt.bz2 ------- Comment #4 from trt at acm dot org 2007-03-21 18:28 ------- I think this could be generalized to more operators, e.g. (y | (x & 7)) & 7 ^ (bitwise or, xor, multiply, ...) This optimization could be for "e & M" where e contains a subexpression of the form "t & N" which can (sometimes) be simplified to "t". I suppose that would require walking the tree. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31261