From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84244 invoked by alias); 16 Dec 2015 20:35:48 -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 83965 invoked by uid 89); 16 Dec 2015 20:35:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=nvptx.h, UD:nvptx.h, nvptxh X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Dec 2015 20:35:46 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id AAF8A8F4F1; Wed, 16 Dec 2015 20:35:45 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBGKZjv6019642; Wed, 16 Dec 2015 15:35:45 -0500 Subject: Re: [RFA] [PATCH] Fix invalid redundant extension elimination for rl78 port To: gcc-patches , rdsandiford@googlemail.com References: <56537379.4030101@redhat.com> <871tb655i9.fsf@googlemail.com> From: Jeff Law Message-ID: <5671CB21.70004@redhat.com> Date: Wed, 16 Dec 2015 20:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <871tb655i9.fsf@googlemail.com> Content-Type: multipart/mixed; boundary="------------020204060801030800040005" X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01657.txt.bz2 This is a multi-part message in MIME format. --------------020204060801030800040005 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1255 On 12/01/2015 12:32 PM, Richard Sandiford wrote: > Jeff Law writes: >> @@ -1080,6 +1070,18 @@ add_removable_extension (const_rtx expr, rtx_insn *insn, >> } >> } >> >> + /* Fourth, if the extended version occupies more registers than the >> + original and the source of the extension is the same hard register >> + as the destination of the extension, then we can not eliminate >> + the extension without deep analysis, so just punt. >> + >> + We allow this when the registers are different because the >> + code in combine_reaching_defs will handle that case correctly. */ >> + if ((HARD_REGNO_NREGS (REGNO (dest), mode) >> + != HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg))) >> + && REGNO (dest) == REGNO (reg)) >> + return; >> + >> /* Then add the candidate to the list and insert the reaching definitions >> into the definition map. */ >> ext_cand e = {expr, code, mode, insn}; > > I might be wrong, but the check looks specific to little-endian. Would > it make sense to use reg_overlap_mentioned_p instead of the REGNO check? Fixed thusly. Installed on the trunk after the usual testing on x86_64-linux-gnu and verifying that rl78-elf doesn't botch pr42833.c. Jeff --------------020204060801030800040005 Content-Type: text/plain; charset=UTF-8; name="P" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="P" Content-length: 1272 commit 362f406136207b89bddab99f5ff904b0798b7115 Author: law Date: Wed Dec 16 20:34:31 2015 +0000 * ree.c (add_removable_extension): Use reg_overlap_mentioned_p rather than testing hard register #s. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231719 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d2a994..a8475b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-16 Jeff Law + + * ree.c (add_removable_extension): Use reg_overlap_mentioned_p + rather than testing hard register #s. + 2015-12-16 Nathan Sidwell * config/nvptx/nvptx.h (OUTGOING_STATIC_CHAIN_REGNUM): Remove. diff --git a/gcc/ree.c b/gcc/ree.c index 6cfc477..d12e24d 100644 --- a/gcc/ree.c +++ b/gcc/ree.c @@ -1085,7 +1085,7 @@ add_removable_extension (const_rtx expr, rtx_insn *insn, code in combine_reaching_defs will handle that case correctly. */ if ((HARD_REGNO_NREGS (REGNO (dest), mode) != HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg))) - && REGNO (dest) == REGNO (reg)) + && reg_overlap_mentioned_p (dest, reg)) return; /* Then add the candidate to the list and insert the reaching definitions --------------020204060801030800040005--