diff mbox

SH2A: Don't push/pop registers for functions with resbank attribute

Message ID 20120330.063959.476018262.kkojima@rr.iij4u.or.jp
State New
Headers show

Commit Message

Kaz Kojima March 29, 2012, 9:39 p.m. UTC
"Naveen H. S" <Naveen.S@kpitcummins.com> 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.

Comments

Naveen H. S March 30, 2012, 11:37 a.m. UTC | #1
Hi,

>> Looks that the patch ignores the case using movml.  
>> It could be something like the attached patch

Sorry for ignoring the case using movml.
Thanks for the patch which takes care of movml case. 

>> though I don't do any tests.

The patch was tested with movml testcase and works as expected. 

Tested with sh2a-elf. No new regressions.

Thanks & Regards,
Naveen
Kaz Kojima March 30, 2012, 9:43 p.m. UTC | #2
"Naveen H. S" <Naveen.S@kpitcummins.com> wrote:
> The patch was tested with movml testcase and works as expected. 
> 
> Tested with sh2a-elf. No new regressions.

Thanks for testing.  I've committed it as revision 186024
on trunk.

Regards,
	kaz
diff mbox

Patch

--- 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);