--- avr.c.old 2010-11-09 14:40:35.000000000 -0600 +++ avr.c.new 2010-11-09 14:37:49.000000000 -0600 @@ -87,6 +87,7 @@ static struct machine_function * avr_init_machine_status (void); static rtx avr_builtin_setjmp_frame_value (void); static bool avr_hard_regno_scratch_ok (unsigned int); +static bool avr_cannot_modify_jumps_p (void); /* Allocate registers from r25 to r8 for parameters for function calls. */ #define FIRST_CUM_REG 26 @@ -361,6 +362,9 @@ #undef TARGET_HARD_REGNO_SCRATCH_OK #define TARGET_HARD_REGNO_SCRATCH_OK avr_hard_regno_scratch_ok +#undef TARGET_CANNOT_MODIFY_JUMPS_P +#define TARGET_CANNOT_MODIFY_JUMPS_P avr_cannot_modify_jumps_p + struct gcc_target targetm = TARGET_INITIALIZER; void @@ -6021,6 +6025,15 @@ return 1; } +/* Avoid jump reording when epilogue is completed or when the function + is naked.*/ + +static bool +avr_cannot_modify_jumps_p (void) +{ + return (epilogue_completed || cfun->machine->is_naked); +} + /* 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).