From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13906 invoked by alias); 25 Nov 2010 11:13:22 -0000 Received: (qmail 13861 invoked by uid 22791); 25 Nov 2010 11:13:19 -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; Thu, 25 Nov 2010 11:13:15 +0000 From: "rguenth 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: rguenth 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: CC 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: Thu, 25 Nov 2010 11:16: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/msg03102.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45685 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org, | |spop at gcc dot gnu.org --- Comment #14 from Richard Guenther 2010-11-25 11:13:06 UTC --- First of all tree if-conversion goes crazy here. What Jakub refers to (optimizing the constants) should be done while we still have the PHIs around: : # val_4 = PHI <1(4), -1(3)> # prephitmp.26_45 = PHI <-1(4), 1(3)> # prephitmp.27_46 = PHI <4294967295(4), 1(3)> # prephitmp.27_48 = PHI <1(4), 4294967295(3)> here at least prephitmp.26_45 = -val_4, prephitmp.27_46 = -prephitmp.27_48, etc. Now - we can teach PRE not to do PHI insertions for sign changes or negations, but it's hard to tell if the insertion involved further simplifications that are worthwhile. We go from : # val_4 = PHI <1(4), -1(11)> ... if (D.4323_24 != i_19) goto ; else goto ; : goto ; : val_25 = -val_4; : # val_3 = PHI ... D.4326_28 = (unsigned int) val_3; to the above, inserting for -val_4 and (unsigned int) val_3. That said, if-conversion should be improved for the case of generating constants.