OSDN Git Service

* sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Aug 2003 19:35:52 +0000 (19:35 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Aug 2003 19:35:52 +0000 (19:35 +0000)
* sh.c (calc_live_regs): Use sh_pr_n_sets to determine if pr
needs saving on SHmedia.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70227 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/config/sh/sh.h

index d299f56..9568cca 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2003-08-07  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.md: Replace all occurrences of \\t with \t.
 2003-08-07  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.md: Replace all occurrences of \\t with \t.
index 8128d47..d64d919 100644 (file)
@@ -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)
      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);
   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--)
     {
   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.  */
          ? pr_live
          : (interrupt_handler && ! pragma_trapa)
          ? (/* Need to save all the regs ever live.  */
index cc94be2..3ab2120 100644 (file)
@@ -926,7 +926,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
      Only the lower 32bits of R10-R14 are guaranteed to be preserved   \
      across SH5 function calls.  */                                    \
   0,      0,      0,      0,      0,      0,      0,      1,           \
      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,      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,           \
   1,      1,      1,      1,      0,      0,      0,      0,           \
   0,      0,      0,      0,      1,      1,      1,      1,           \
   1,      1,      1,      1,      0,      0,      0,      0,           \
@@ -946,7 +946,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
 /* XD registers.  */                                                   \
   1,      1,      1,      1,      1,      1,      0,      0,           \
 /*"gbr",  "ap",          "pr",   "t",    "mach", "macl", "fpul", "fpscr", */   \
 /* 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,           \
+  1,      1,      1,      1,      1,      1,      1,      1,           \
 /*"rap" */                                                             \
   1,                                                                   \
 }
 /*"rap" */                                                             \
   1,                                                                   \
 }