From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31297 invoked by alias); 17 May 2011 07:10:55 -0000 Received: (qmail 31289 invoked by uid 22791); 17 May 2011 07:10:54 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,DATE_IN_FUTURE_03_06,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 May 2011 07:10:40 +0000 Received: (qmail 9498 invoked from network); 17 May 2011 07:10:39 -0000 Received: from unknown (HELO ?192.168.1.26?) (cltang@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 May 2011 07:10:39 -0000 Message-ID: <4DD273C4.6020104@codesourcery.com> Date: Tue, 17 May 2011 07:22:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches , Richard Earnshaw , Ramana Radhakrishnan , rdsandiford@googlemail.com Subject: Re: [patch, ARM] Fix PR42017, LR not used in leaf functions References: <4DB8DB6D.1050107@codesourcery.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040605070904010406030806" X-IsSubscribed: yes 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 X-SW-Source: 2011-05/txt/msg01189.txt.bz2 This is a multi-part message in MIME format. --------------040605070904010406030806 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1472 On 2011/5/13 04:26 PM, Richard Sandiford wrote: > Richard Sandiford writes: >> Chung-Lin Tang writes: >>> My fix here simply adds 'reload_completed' as an additional condition >>> for EPILOGUE_USES to return true for LR_REGNUM. I think this should be >>> valid, as correct LR save/restoring is handled by the epilogue/prologue >>> code; it should be safe for IRA to treat it as a normal call-used register. >> >> FWIW, epilogue_completed might be a more accurate choice. > > I still stand by this, although I realise no other target does it. Did a re-test of the patch just to be sure, as expected the test results were also clear. Attached is the updated patch. >> It seems a lot of other ports suffer from the same problem though. >> I wonder which targets really do want to make a register live throughout >> the function? If none do, perhaps we should say that this macro is >> only meaningful once the epilogue has been generated. > > To answer my own question, I suppose VRSAVE is one. So I was wrong > about the target-independent "fix". > > Richard To rehash what I remember we discussed at LDS, such registers like VRSAVE might be more appropriately placed in global regs. It looks like EPILOGUE_USES could be more clarified in its use... To Richard Earnshaw and Ramana, is the patch okay for trunk? This should be a not-so-insignificant performance regression-fix/improvement. Thanks, Chung-Lin --------------040605070904010406030806 Content-Type: text/plain; name="arm-epilogue_uses-2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="arm-epilogue_uses-2.diff" Content-length: 492 Index: config/arm/arm.h =================================================================== --- config/arm/arm.h (revision 173814) +++ config/arm/arm.h (working copy) @@ -1627,7 +1627,7 @@ frame. */ #define EXIT_IGNORE_STACK 1 -#define EPILOGUE_USES(REGNO) ((REGNO) == LR_REGNUM) +#define EPILOGUE_USES(REGNO) (epilogue_completed && (REGNO) == LR_REGNUM) /* Determine if the epilogue should be output as RTL. You should override this if you define FUNCTION_EXTRA_EPILOGUE. */ --------------040605070904010406030806--