Hi Ramana, Please find attached reworked patch. The patch is tested with check-gcc, check-gdb and bootstrap with no regression. On Fri, 2011-10-21 at 13:43 +0100, Ramana Radhakrishnan wrote: > Why are you differentiating on stack_only ? Does it really matter ? > The patterns pop_multi* generate pop instruction, hence I wanted to be sure that base register is stack. I can remove stack_only option by 1. Modifying pattern to match SP as base-register explicitly or 2. Generate ldm%(ia%) instruction for non-SP base registers. I chose second option. > Hmmm isn't this true of only LDM's in Thumb state ? Though it could be argued > that this patch is only T2 epilogues. > Yes, its true. But for single register we want to match LDR pattern and not any of ldm* or pop_multi* pattern. So, I am barring LDM for single register here. > >+ strcpy (pattern, \"fldmfdd\\t\"); > >+ strcat (pattern, > >+ reg_names[REGNO (SET_DEST (XVECEXP (operands[0], 0, 0)))]); > >+ strcat (pattern, \"!, {\"); > >+ strcat (pattern, table[(REGNO (XEXP (XVECEXP (operands[0], 0, 1), 0)) > >+ - FIRST_VFP_REGNUM) / 2].name); > > Can't you reuse names from arm.h and avoid the table here ? > The array REGISTER_NAMES in aout.h use S0, S2, ... names for double registers. Is there any way to use OVERLAPPING_REGISTER_NAMES? If that can be done, I can eliminate the table here. Updated ChangeLog entry: 2011-09-28 Ian Bolton Sameera Deshpande * config/arm/arm-protos.h (load_multiple_operation_p): New declaration. (thumb2_expand_epilogue): Likewise. (thumb2_output_return): Likewise (thumb2_expand_return): Likewise. (thumb_unexpanded_epilogue): Rename to... (thumb1_unexpanded_epilogue): ...this * config/arm/arm.c (load_multiple_operation_p): New function. (thumb2_emit_multi_reg_pop): Likewise. (thumb2_emit_vfp_multi_reg_pop): Likewise. (thumb2_expand_return): Likewise. (thumb2_expand_epilogue): Likewise. (thumb2_output_return): Likewise (thumb_unexpanded_epilogue): Rename to... ( thumb1_unexpanded_epilogue): ...this * config/arm/arm.md (pop_multiple_with_stack_update): New pattern. (pop_multiple_with_stack_update_and_return): Likewise. (thumb2_ldr_with_return): Likewise. (vfp_point_pop_multiple_with_stack_update): Likewise. (return): Update condition and code for pattern. (arm_return): Likewise. (epilogue_insns): Likewise. * config/arm/predicates.md (load_multiple_operation): Update predicate. (load_multiple_operation_return): New predicate. (load_multiple_operation_fp): Likewise. * config/arm/thumb2.md (thumb2_return): Remove. (thumb2_rtl_epilogue_return): New pattern. - Thanks and regards, Sameera D.