diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-05 20:00:03 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-05 20:00:03 +0000 |
commit | 01272fdfe1e85da18da78ab1b1b85f4c59274630 (patch) | |
tree | 2b87ffa541f244e659a763135c0a297e365ee48e | |
parent | 273014f4da15a8bacf3b7b81684855ec6dc95899 (diff) | |
download | gcc-01272fdfe1e85da18da78ab1b1b85f4c59274630.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71119 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/h8300/h8300-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 17 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0b2e2bdfd9..f830816a7cb 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 d99f0dca0b9..e36ae4b719c 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 5ab2bfac04d..3d874c2c085 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 8e5e96e0e2a..c4103d0464f 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. */ |