aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNitin Yewale <nitiny@kpitcummins.com>2003-09-05 20:00:03 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-09-05 20:00:03 +0000
commitc87ec0bae2def5ed65950b8fcb54e7225146a7ea (patch)
tree2b87ffa541f244e659a763135c0a297e365ee48e /gcc
parent31ff3e0b7728ede11862345df0347fc3403a5259 (diff)
downloadgcc-c87ec0bae2def5ed65950b8fcb54e7225146a7ea.zip
gcc-c87ec0bae2def5ed65950b8fcb54e7225146a7ea.tar.gz
gcc-c87ec0bae2def5ed65950b8fcb54e7225146a7ea.tar.bz2
h8300-protos.h: Declare h8300_hard_regno_rename_ok
* config/h8300/h8300-protos.h: Declare h8300_hard_regno_rename_ok * config/h8300/h8300.h (HARD_REGNO_RENAME_OK): New. * config/h8300/h8300.c (h8300_hard_regno_rename_ok): New. From-SVN: r71119
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c17
-rw-r--r--gcc/config/h8300/h8300.h6
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c0b2e2b..f830816 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-05 Nitin Yewale <NitinY@KPITCummins.com>
+
+ * config/h8300/h8300-protos.h: Declare h8300_hard_regno_rename_ok
+ * config/h8300/h8300.h (HARD_REGNO_RENAME_OK): New.
+ * config/h8300/h8300.c (h8300_hard_regno_rename_ok): New.
+
2003-09-05 Roger Sayle <roger@eyesopen.com>
Richard Henderson <rth@redhat.com>
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index d99f0dc..e36ae4b 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -98,6 +98,7 @@ extern void h8300_expand_prologue (void);
extern void h8300_expand_epilogue (void);
extern int h8300_current_function_interrupt_function_p (void);
extern int h8300_initial_elimination_offset (int, int);
+extern int h8300_hard_regno_rename_ok (unsigned int, unsigned int);
struct cpp_reader;
extern void h8300_pr_interrupt (struct cpp_reader *);
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 5ab2bfac..3d874c2 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -4489,6 +4489,23 @@ same_cmp_preceding_p (rtx i3)
return (INSN_P (i1) && rtx_equal_p (PATTERN (i1), PATTERN (i3))
&& any_condjump_p (i2) && onlyjump_p (i2));
}
+
+/* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */
+
+int
+h8300_hard_regno_rename_ok (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 (h8300_current_function_interrupt_function_p ()
+ && !regs_ever_live[new_reg])
+ return 0;
+
+ return 1;
+}
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 8e5e96e..c4103d0 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -350,6 +350,12 @@ extern int target_flags;
&& ((MODE2) == QImode || (MODE2) == HImode \
|| ((TARGET_H8300H || TARGET_H8300S) && (MODE2) == SImode))))
+/* 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) \
+ h8300_hard_regno_rename_ok (OLD_REG, NEW_REG)
+
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */