From patchwork Thu Mar 29 21:39:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaz Kojima X-Patchwork-Id: 149495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F05CCB6F6E for ; Fri, 30 Mar 2012 08:40:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333662037; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:Message-Id:To:Cc:Subject:From:In-Reply-To:References: Mime-Version:Content-Type:Content-Transfer-Encoding:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=bUVeRGFZEQIDTNWr8GY0mFPftNU=; b=EsZPvC9bGLLojyWsEKjspNONCyBHJUiXAkFKRlZnEftStXZXni6wXJESVyFwy7 LNfDxldYSGcFpBvbF8rCv1to0Zt5r+jnPxDKrvrXAGUNuGJ3aJM4DL3TjOHPxudA 2KW4HmnP11AQLvFYNVSG82KfXd4myODmpYcnPMUET3Aq8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:Message-Id:To:Cc:Subject:From:In-Reply-To:References:Mime-Version:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=j8mzl09DmuMKOCpq9JM1J49GtbdiLa9ymNH74/Xqa5iS5bK5sB6qjk4P5eUoGG 8jGzJ3LE/j2WZjT/LuftT6GgseOH2mF2Wu5ejZ0tFbRsxcCqF2yGrFimTxFa0BmL nV9Q+X89+18eKVMVj4L8pZj+MKzqU4Tzs/+31rOPdEUYM=; Received: (qmail 22868 invoked by alias); 29 Mar 2012 21:40:23 -0000 Received: (qmail 22799 invoked by uid 22791); 29 Mar 2012 21:40:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mo11.iij4u.or.jp (HELO mo.iij4u.or.jp) (210.138.174.79) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Mar 2012 21:40:01 +0000 Received: by mo.iij4u.or.jp (mo11) id q2TLe070032189; Fri, 30 Mar 2012 06:40:00 +0900 Received: from localhost (238.152.138.210.bn.2iij.net [210.138.152.238]) by mbox.iij4u.or.jp (mbox11) id q2TLdxI6019240; Fri, 30 Mar 2012 06:39:59 +0900 Date: Fri, 30 Mar 2012 06:39:59 +0900 (JST) Message-Id: <20120330.063959.476018262.kkojima@rr.iij4u.or.jp> To: Naveen.S@kpitcummins.com Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] SH2A: Don't push/pop registers for functions with resbank attribute From: Kaz Kojima In-Reply-To: <5CD0E437A05A514A90A1B12527F331542BC779FA@KCHJEXMB01.kpit.com> References: <5CD0E437A05A514A90A1B12527F331542BC779FA@KCHJEXMB01.kpit.com> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org "Naveen H. S" wrote: > Please find attached the patch "resbank.patch" which fixes the issue > with "resbank" attribute. Currently, registers used in the routine are > also saved on using resbank attribute. These registers are saved with > resbank instruction and need not be saved separately. > The patch fixes the issue. Looks that the patch ignores the case using movml. It could be something like the attached patch, though I don't do any tests. * config/sh/sh.c (push_regs): Skip banked registers when resbank attribute is specified. (sh_expand_epilogue): Likewise. --- ORIG/trunk/gcc/config/sh/sh.c 2012-03-28 17:51:20.000000000 +0900 +++ trunk/gcc/config/sh/sh.c 2012-03-29 21:59:13.000000000 +0900 @@ -6487,7 +6487,9 @@ push_regs (HARD_REG_SET *mask, int inter use_movml = true; } - if (use_movml) + if (sh_cfun_resbank_handler_p ()) + ; /* Do nothing. */ + else if (use_movml) { rtx x, mem, reg, set; rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM); @@ -7485,7 +7487,9 @@ sh_expand_epilogue (bool sibcall_p) use_movml = true; } - if (use_movml) + if (sh_cfun_resbank_handler_p ()) + ; /* Do nothing. */ + else if (use_movml) { rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);