From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17747 invoked by alias); 6 Jan 2010 15:16:45 -0000 Received: (qmail 17671 invoked by uid 48); 6 Jan 2010 15:16:26 -0000 Date: Wed, 06 Jan 2010 15:16:00 -0000 Subject: [Bug tree-optimization/42635] New: no-op conversions hinder if-conversion X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth 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-01/txt/msg00648.txt.bz2 The following two functions are not if-converted at the tree level (the 2nd example happens a lot from VEC code via VEC_BASE): int *bar (char *p) { int *q; if (p) q = (int *)p; else q = (int *)0; return q; } struct X { int q; }; int *foo (struct X *p) { int *q; if (p) q = &p->q; else q = (int *)0; return q; } before phiopt1 we have bar (char * p) { int * q; : if (p_2(D) != 0B) goto ; else goto ; : q_3 = (int *) p_2(D); : # q_1 = PHI return q_1; which can be optimized to just : return (int *) p_2(D); well - with a separate stmt for the conversion. -- Summary: no-op conversions hinder if-conversion Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42635