From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10028 invoked by alias); 22 Jul 2010 18:52:15 -0000 Received: (qmail 9965 invoked by uid 48); 22 Jul 2010 18:52:03 -0000 Date: Thu, 22 Jul 2010 18:52:00 -0000 Subject: [Bug tree-optimization/45032] New: Missed optimization in ifcvt/crossjump X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rth 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: 2010-07/txt/msg02419.txt.bz2 int f(int x, int y); int g(int x, int z) { int r; if (z == 0) r = f(x, 1); else r = f(x, 0); return r + 1; } could be optimized to r = f(x, (z == 0 ? 1 : 0)); which would reduce the size of the generated code, and for most targets allow further simplifications on the COND_EXPR leading to branchless assembly. -- Summary: Missed optimization in ifcvt/crossjump Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45032