diff options
| author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 17:41:13 +0000 |
|---|---|---|
| committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 17:41:13 +0000 |
| commit | cf695b54e6582d0d2785417d6a1101d2674542e8 (patch) | |
| tree | 19660cc29a261ba90312a4177c9d8c7c38e37f47 /gcc | |
| parent | b79906a3c99291824d12c57a9d0eda4ddbf560c8 (diff) | |
| download | ppe42-gcc-cf695b54e6582d0d2785417d6a1101d2674542e8.tar.gz ppe42-gcc-cf695b54e6582d0d2785417d6a1101d2674542e8.zip | |
* config/h8300/h8300.c (h8300_hard_regno_scratch_ok): New.
(TARGET_HARD_REGNO_SCRATCH_OK): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138038 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/config/h8300/h8300.c | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4838ebe83be..951d26375d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-07-21 DJ Delorie <dj@redhat.com> + + * config/h8300/h8300.c (h8300_hard_regno_scratch_ok): New. + (TARGET_HARD_REGNO_SCRATCH_OK): Define. + 2008-07-21 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> * config/spu/spu.md ("div<mode>3"): Convert into expander, move diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index f90bd414735..86790699f13 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -111,6 +111,7 @@ static unsigned int h8300_bitfield_length (rtx, rtx); static unsigned int h8300_binary_length (rtx, const h8300_length_table *); static bool h8300_short_move_mem_p (rtx, enum rtx_code); static unsigned int h8300_move_length (rtx *, const h8300_length_table *); +static bool h8300_hard_regno_scratch_ok (unsigned int); /* CPU_TYPE, says what cpu we're compiling for. */ int cpu_type; @@ -5612,6 +5613,20 @@ h8300_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED, return 1; } +/* Returns true if register REGNO is safe to be allocated as a scratch + register in the current function. */ + +static bool +h8300_hard_regno_scratch_ok (unsigned int regno) +{ + if (h8300_current_function_interrupt_function_p () + && ! WORD_REG_USED (regno)) + return false; + + return true; +} + + /* Return nonzero if X is a legitimate constant. */ int @@ -5745,6 +5760,9 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) #undef TARGET_MACHINE_DEPENDENT_REORG #define TARGET_MACHINE_DEPENDENT_REORG h8300_reorg +#undef TARGET_HARD_REGNO_SCRATCH_OK +#define TARGET_HARD_REGNO_SCRATCH_OK h8300_hard_regno_scratch_ok + #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT |

