From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14195 invoked by alias); 2 Sep 2005 09:54:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14175 invoked by uid 48); 2 Sep 2005 09:54:53 -0000 Date: Fri, 02 Sep 2005 09:54:00 -0000 Message-ID: <20050902095453.14174.qmail@sourceware.org> From: "rguenth at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050720134633.22568.arndt@jjj.de> References: <20050720134633.22568.arndt@jjj.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug rtl-optimization/22568] Should use cmov in some stituations X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg00190.txt.bz2 List-Id: ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-02 09:54 ------- Blindly applying ifcvt to something like int a,b; void foo(int flag) { int x; if (flag) x=a,a=b,b=x; } because we're presented with if (flag) { int reg_a = a; x = reg_a; int reg_b = b; a = reg_b; b = x; } and we get cmovs for loading a,b into pseudos instead of loading them unconditionally. F.i. int a,b; void foobar(int flag) { if (flag) a = b; } will become foobar: movl 4(%esp), %eax # flag, flag testl %eax, %eax # flag cmovne b, %edx # b,, b movl a, %eax # a, tmp61 cmovne %edx, %eax # b,, tmp61 movl %eax, a # tmp61, a ret notice how we special-cased the _store_ to use a temporary. I'll try applying the same for loads. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568