From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6066 invoked by alias); 11 Jun 2013 04:47:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 6052 invoked by uid 89); 11 Jun 2013 04:47:37 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 11 Jun 2013 04:47:36 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UmGUY-0005Qp-FY from meador_inge@mentor.com ; Mon, 10 Jun 2013 21:47:34 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 10 Jun 2013 21:47:34 -0700 Received: from [172.30.10.105] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Mon, 10 Jun 2013 21:47:33 -0700 Message-ID: <51B6ABE2.90007@codesourcery.com> Date: Tue, 11 Jun 2013 04:47:00 -0000 From: Meador Inge User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Richard Earnshaw CC: "gcc-patches@gcc.gnu.org" , Ramana Radhakrishnan Subject: Re: [PATCH] ARM: Don't clobber CC reg when it is live after the peephole window References: <1369847707-8357-1-git-send-email-meadori@codesourcery.com> <51B08A77.7020700@arm.com> <51B0D3A3.2020306@codesourcery.com> In-Reply-To: <51B0D3A3.2020306@codesourcery.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00557.txt.bz2 On 06/06/2013 01:23 PM, Meador Inge wrote: > On 06/06/2013 08:11 AM, Richard Earnshaw wrote: > >> I understand (and agree with) this bit... >> >>> +(define_peephole2 >>> + [(set (reg:CC CC_REGNUM) >>> + (compare:CC (match_operand:SI 0 "register_operand" "") >>> + (match_operand:SI 1 "arm_rhs_operand" ""))) >>> + (cond_exec (ne (reg:CC CC_REGNUM) (const_int 0)) >>> + (set (match_operand:SI 2 "register_operand" "") (const_int 0))) >>> + (cond_exec (eq (reg:CC CC_REGNUM) (const_int 0)) >>> + (set (match_dup 2) (const_int 1))) >>> + (match_scratch:SI 3 "r")] >>> + "TARGET_32BIT && !peep2_reg_dead_p (3, operands[0])" >>> + [(set (match_dup 3) (minus:SI (match_dup 0) (match_dup 1))) >>> + (parallel >>> + [(set (reg:CC CC_REGNUM) >>> + (compare:CC (const_int 0) (match_dup 3))) >>> + (set (match_dup 2) (minus:SI (const_int 0) (match_dup 3)))]) >>> + (set (match_dup 2) >>> + (plus:SI (plus:SI (match_dup 2) (match_dup 3)) >>> + (geu:SI (reg:CC CC_REGNUM) (const_int 0))))]) >>> + >> >> ... but what's this bit about? > > The original intent was to revert back to the original peephole pattern > (pre-PR 46975) when the CC reg is still live, but that doesn't properly > maintain the CC state either (it just happened to pass in the test > case I was looking at because I only cared about the Z flag, which is > maintained the same). > > OK with the above bit left out? OK? -- Meador Inge CodeSourcery / Mentor Embedded