From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9787 invoked by alias); 24 Nov 2010 18:31:31 -0000 Received: (qmail 9725 invoked by uid 22791); 24 Nov 2010 18:31:30 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Nov 2010 18:31:26 +0000 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45685] [4.6 Regression] missed conditional move opportunity in loop X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: Status Component AssignedTo Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 24 Nov 2010 19:15:00 -0000 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-11/txt/msg03021.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45685 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Component|rtl-optimization |tree-optimization AssignedTo|ebotcazou at gcc dot |unassigned at gcc dot |gnu.org |gnu.org --- Comment #12 from Eric Botcazou 2010-11-24 18:31:18 UTC --- Clearly ifcvt.c is overwhelmed here and somewhat shoots itself in the foot. The noce_emit_store_flag transformation in pass n creates insns that block the cond_move_process_if_block conversion in pass n+1 because the new insns are (rightfully) deemed unsuitable. Quite tricky to overcome in my opinion. As Jakub said, creating 3 almost identical cond_expr: prephitmp.9_39 = [cond_expr] D.2693_11 <= 0 ? -1 : 1; prephitmp.10_40 = [cond_expr] D.2693_11 <= 0 ? 1 : -1; prephitmp.11_41 = [cond_expr] D.2693_11 <= 0 ? 1 : -1; for only one in the source code: int val = (products[i] > 0) ? 1 : -1; is simply unreasonable. Thus recategorizing.