diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 708142e..1fb86fd 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -264,7 +264,7 @@ static reg_class_t arm_preferred_rename_class (reg_class_t rclass); static unsigned int arm_autovectorize_vector_sizes (void); static int arm_default_branch_cost (bool, bool); static int arm_cortex_a5_branch_cost (bool, bool); - +static void arm_epilogue_restore_iwmmxt_regs (void); /* Table of machine attributes. */ static const struct attribute_spec arm_attribute_table[] = @@ -22563,6 +22563,30 @@ thumb2_expand_return (void) } } +static void +arm_epilogue_restore_iwmmxt_regs (void) +{ + + int reg; + for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) + if (df_regs_ever_live_p (reg) && !call_used_regs[reg]) + { + rtx tmp = gen_rtx_SET (DImode, + gen_rtx_REG (reg, DImode), + gen_frame_mem (DImode, + gen_rtx_POST_INC + (DImode, + stack_pointer_rtx))); + rtx dwarf = alloc_reg_note (REG_CFA_RESTORE, + gen_rtx_REG (reg, DImode), + NULL_RTX); + + RTX_FRAME_RELATED_P (tmp) = 1; + emit_insn (tmp); + } + +} + /* Generate RTL to represent a Thumb-2 epilogue. Note that this RTL does not include the @@ -22652,6 +22676,10 @@ thumb2_expand_epilogue (void) /* iWMMXt is not supported when Thumb-2 in use. If it were, we would want to be restoring the appropriate iWMMXt regs here, in a similar way to arm_output_epilogue. */ + if (TARGET_IWMMXT) + { + arm_epilogue_restore_iwmmxt_regs (); + } /* If there are registers to restore, make it happen. */ if (saved_regs_mask)