This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch applied to SH port


2003-08-07  J"orn Rennecke <joern.rennecke@superh.com>

	* sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG.
	* sh.c (calc_live_regs): Use sh_pr_n_sets to determine if pr
	needs saving on SHmedia.

Index: sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.231
diff -p -u -r1.231 sh.c
--- sh.c	6 Aug 2003 19:33:08 -0000	1.231
+++ sh.c	7 Aug 2003 16:02:45 -0000
@@ -4848,7 +4848,7 @@ calc_live_regs (live_regs_mask)
      the initial value can become the PR_MEDIA_REG hard register, as seen for
      execute/20010122-1.c:test9.  */
   if (TARGET_SHMEDIA)
-    pr_live = regs_ever_live[PR_MEDIA_REG];
+    pr_live = sh_pr_n_sets ();
   else
     {
       rtx pr_initial = has_hard_reg_initial_val (Pmode, PR_REG);
@@ -4867,7 +4867,7 @@ calc_live_regs (live_regs_mask)
   has_call = TARGET_SHMEDIA ? ! leaf_function_p () : pr_live;
   for (count = 0, reg = FIRST_PSEUDO_REGISTER - 1; reg >= 0; reg--)
     {
-      if ((! TARGET_SHMEDIA && reg == PR_REG)
+      if (reg == (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG)
 	  ? pr_live
 	  : (interrupt_handler && ! pragma_trapa)
 	  ? (/* Need to save all the regs ever live.  */
Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.218
diff -p -r1.218 sh.h
*** config/sh/sh.h	6 Aug 2003 19:33:11 -0000	1.218
--- config/sh/sh.h	7 Aug 2003 19:26:38 -0000
*************** extern char sh_additional_register_names
*** 926,932 ****
       Only the lower 32bits of R10-R14 are guaranteed to be preserved	\
       across SH5 function calls.  */					\
    0,      0,      0,      0,      0,      0,      0,      1,		\
!   1,      1,      0,      1,      1,      1,      1,      1,		\
    1,      1,      1,      1,      0,      0,      0,      0,		\
    0,      0,      0,      0,      1,      1,      1,      1,		\
    1,      1,      1,      1,      0,      0,      0,      0,		\
--- 926,932 ----
       Only the lower 32bits of R10-R14 are guaranteed to be preserved	\
       across SH5 function calls.  */					\
    0,      0,      0,      0,      0,      0,      0,      1,		\
!   1,      1,      1,      1,      1,      1,      1,      1,		\
    1,      1,      1,      1,      0,      0,      0,      0,		\
    0,      0,      0,      0,      1,      1,      1,      1,		\
    1,      1,      1,      1,      0,      0,      0,      0,		\
*************** extern char sh_additional_register_names
*** 946,952 ****
  /* XD registers.  */							\
    1,      1,      1,      1,      1,      1,      0,      0,		\
  /*"gbr",  "ap",	  "pr",   "t",    "mach", "macl", "fpul", "fpscr", */	\
!   1,      1,      0,      1,      1,      1,      1,      1,		\
  /*"rap" */								\
    1,									\
  }
--- 946,952 ----
  /* XD registers.  */							\
    1,      1,      1,      1,      1,      1,      0,      0,		\
  /*"gbr",  "ap",	  "pr",   "t",    "mach", "macl", "fpul", "fpscr", */	\
!   1,      1,      1,      1,      1,      1,      1,      1,		\
  /*"rap" */								\
    1,									\
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]