]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fri Jun 14 12:04:02 2002 Dhananjay R. Deshpande <dhananjayd@kpit.com>
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2002 11:06:38 +0000 (11:06 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2002 11:06:38 +0000 (11:06 +0000)
* sh.h: Define HARD_REGNO_RENAME_OK
* sh.c: sh_hard_regno_rename_ok: New. If current function has
interrupt_handler attribute, only registers saved on stack are OK.
* sh-protos.h: Declare sh_hard_regno_rename_ok.

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

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

index 6176f6898562e58a42da41469a17e1e89beb4bd5..d5d900f801e62b902049f5dff0b2566b57a46e63 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jun 14 12:04:02 2002  Dhananjay R. Deshpande <dhananjayd@kpit.com>
+
+       * sh.h: Define HARD_REGNO_RENAME_OK
+       * sh.c: sh_hard_regno_rename_ok: New. If current function has
+       interrupt_handler attribute, only registers saved on stack are OK.
+       * sh-protos.h: Declare sh_hard_regno_rename_ok.
+
 2002-06-14  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * config/sh/sh.md (jump): Emit jump insn.
index 6abdfe6258d94725759b6b8c041881897c2b68ee..3503f57948a6aba8c6a209391ce668163ec9be84 100644 (file)
@@ -122,6 +122,7 @@ extern int sh_need_epilogue PARAMS ((void));
 extern int initial_elimination_offset PARAMS ((int, int));
 extern int fldi_ok PARAMS ((void));
 extern int sh_pr_n_sets PARAMS ((void));
+extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
 
 #ifdef HARD_CONST
 extern void fpscr_set_from_mem PARAMS ((int, HARD_REG_SET));
index a9c2e8250a4c81211746a71499eaf0756052683c..22851372405aca8df395f41f8a74bb5b9e325310 100644 (file)
@@ -6701,6 +6701,26 @@ sh_can_redirect_branch (branch1, branch2)
   return 0;
 }
 
+/* Return non-zero if register old_reg can be renamed to register new_reg.  */
+int
+sh_hard_regno_rename_ok (old_reg, new_reg)
+     unsigned int old_reg ATTRIBUTE_UNUSED;
+     unsigned int new_reg;
+{
+
+/* Interrupt functions can only use registers that have already been
+   saved by the prologue, even if they would normally be
+   call-clobbered.  */
+
+   if ((lookup_attribute ("interrupt_handler",
+                         DECL_ATTRIBUTES (current_function_decl))
+       != NULL_TREE)
+       && !regs_ever_live[new_reg])
+     return 0;
+
+   return 1;
+}
+
 /* A C statement (sans semicolon) to update the integer variable COST
    based on the relationship between INSN that is dependent on
    DEP_INSN through the dependence LINK.  The default is to make no
index fef996a8f1253d5429d3c15c3f463f72263001ee..6891fd0758b0e4df6156f5688bb4aa75c729ab34 100644 (file)
@@ -942,6 +942,12 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
                              && (GET_MODE_SIZE (MODE2) <= 4)) \
                          : ((MODE1) != SFmode && (MODE2) != SFmode))))
 
+/* A C expression that is nonzero if hard register NEW_REG can be
+   considered for use as a rename register for OLD_REG register */
+
+#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
+   sh_hard_regno_rename_ok (OLD_REG, NEW_REG)
+
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */