From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125384 invoked by alias); 31 Mar 2015 10:44:41 -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 Received: (qmail 125340 invoked by uid 48); 31 Mar 2015 10:44:37 -0000 From: "linux at carewolf dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65492] Bad optimization in -O3 due to if-conversion and/or unrolling Date: Tue, 31 Mar 2015 11:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: linux at carewolf dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg03485.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65492 --- Comment #12 from Allan Jensen --- I have a very crude fix for this. First though, according to comments in tree-if-conv.c and earlier bugs on the issues. If-conversion is suppposed to be conditional. It performed in a piece of conditionally code only to be used if vectorized. For some reason this version appears to be used. But secondly. If conditional move instructions are generally slower than branches, shouldn't they be avoided during instruction selections? The crude fix is simply placing a 'return false;' in the top of ix86_expand_int_movcc in i386.c. So this case somehow triggers a case where the if-conversion that is supposed to only be used by vectorization gets used anyway, but more generally, i386 shouldn't be generating cmov instructions for conditional moves in the first place for modern architectures (anything newer than core2 and bulldozer). At least not without input from a profile run.