diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/m32r/m32r-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.c | 20 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.h | 3 |
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 857027c..877299f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-06-10 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> + + * config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New. + * config/m32r/m32r.c (m32r_hard_regno_rename_ok): New. + * config/m32r/m32r-protos.h: Prototype it. + 2003-06-10 Janis Johnson <janis187@us.ibm.com> * config/rs6000/eabi.h (TARGET_OS_CPP_BUILTINS): Define builtins diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h index 3816dd5..ec549ba 100644 --- a/gcc/config/m32r/m32r-protos.h +++ b/gcc/config/m32r/m32r-protos.h @@ -55,6 +55,8 @@ extern void m32r_expand_block_move PARAMS ((rtx *)); extern void m32r_print_operand PARAMS ((FILE *, rtx, int)); extern void m32r_print_operand_address PARAMS ((FILE *, rtx)); extern int m32r_not_same_reg PARAMS ((rtx, rtx)); +extern int m32r_hard_regno_rename_ok PARAMS ((unsigned int, + unsigned int)); #ifdef HAVE_MACHINE_MODES extern int call_address_operand PARAMS ((rtx, Mmode)); diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index a4d3c12..4ea130f 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -2944,3 +2944,23 @@ m32r_block_immediate_operand (op, mode) return 1; } + +/* Return true if using NEW_REG in place of OLD_REG is ok. */ + +int +m32r_hard_regno_rename_ok (old_reg, new_reg) + unsigned int old_reg ATTRIBUTE_UNUSED; + unsigned int new_reg; +{ + /* Interrupt routines can't clobber any register that isn't already used. */ + if (lookup_attribute ("interrupt", DECL_ATTRIBUTES (current_function_decl)) + && !regs_ever_live[new_reg]) + return 0; + + /* We currently emit epilogues as text, not rtl, so the liveness + of the return address register isn't visible. */ + if (current_function_is_leaf && new_reg == RETURN_ADDR_REGNUM) + return 0; + + return 1; +} diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index ab7d5fc..7af28e5 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -657,6 +657,9 @@ extern unsigned int m32r_mode_class[]; && GET_MODE_CLASS (MODE2) == MODE_INT \ && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \ && GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD) + +#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \ + m32r_hard_regno_rename_ok (OLD_REG, NEW_REG) /* Register classes and constants. */ |