From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29119 invoked by alias); 20 Sep 2007 22:32:26 -0000 Received: (qmail 29041 invoked by uid 48); 20 Sep 2007 22:32:08 -0000 Date: Thu, 20 Sep 2007 22:32:00 -0000 Subject: [Bug rtl-optimization/33512] New: Simple bitwise simplification missed X-Bugzilla-Reason: CC Message-ID: 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-09/txt/msg01717.txt.bz2 These two functions should produce the same code: int f(int y, int x) { return x & ((~x) | y); } int g(int y, int x) { return y & x; } x & ((~x) | y) is the same as (x & ~x) | (x & y) using distribution and that becomes (x & y) because (x & ~x) is always 0 and 0 | x is x. This should be done at both the tree level and the RTL level. -- Summary: Simple bitwise simplification missed Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33512