+2008-07-08 Anatoly Sokolov <aesok@post.ru>
+
+ PR target/36424
+ * config/avr/avr.h (HARD_REGNO_RENAME_OK): Define.
+ * config/avr/avr.c (avr_hard_regno_rename_ok): New function.
+ * config/avr/avr-protos.h (avr_hard_regno_rename_ok): New prototype.
+
2008-06-07 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/cygming.h (MAYBE_UWIN_CPP_BUILTINS): Remove.
extern int avr_simple_epilogue (void);
extern void gas_output_limited_string (FILE *file, const char *str);
extern void gas_output_ascii (FILE *file, const char *str, size_t length);
+extern int avr_hard_regno_rename_ok (unsigned int, unsigned int);
#ifdef TREE_CODE
extern void asm_output_external (FILE *file, tree decl, char *name);
return 1;
}
+/* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */
+
+int
+avr_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 ((cfun->machine->is_interrupt || cfun->machine->is_signal)
+ && !df_regs_ever_live_p (new_reg))
+ return 0;
+
+ return 1;
+}
+
/* Output a branch that tests a single bit of a register (QI, HI or SImode)
or memory location in the I/O space (QImode only).
#define OBJECT_FORMAT_ELF
+#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
+ avr_hard_regno_rename_ok (OLD_REG, NEW_REG)
+
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
struct machine_function GTY(())