Re: [PATCH] SH2A: Don't push/pop registers for functions with resbank attribute

2012-03-30 Thread Kaz Kojima
"Naveen H. S"  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


RE: [PATCH] SH2A: Don't push/pop registers for functions with resbank attribute

2012-03-30 Thread Naveen H. S
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




Re: [PATCH] SH2A: Don't push/pop registers for functions with resbank attribute

2012-03-29 Thread Kaz Kojima
"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.0 +0900
+++ trunk/gcc/config/sh/sh.c2012-03-29 21:59:13.0 +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);
 


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

2012-03-29 Thread Naveen H. S
Hi,

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. 

Tested with sh2a-elf. Regression results are good.

ChangeLog
2012-03-29  Naveen H.S  

* config/sh/sh.c (push_regs): Condition added for resbank attribute.
(sh_expand_epilogue): Condition added for resbank attribute.

Thanks & Regards,
Naveen



resbank.patch
Description: resbank.patch