On 25/11/13 11:33, Charles Baylis wrote: > This bug reveals a long standing problem in the ARM ldm/stm patterns > which allow the virtual hardware register 'afp' to be used. A similar > problem may affect vfp_pop_multiple_with_writeback, so that is also > addressed. > > I have not included a test case, as the original preprocessed source > is rather bulky, and automated reduction seems to result in a file > which does not robustly reproduce the problem across different gcc > versions. > > PR target/59142 > gcc/ > * config/arm/predicates.md: New predicates > arm_hard_general_register_operand, vfp_hard_register_operand.
This should read: * arm/predicates.md (arm_hard_general_register_operand): New predicate. (vfp_hard_register_operand): Likewise. > * config/arm/arm-ldmstm.ml: Use > arm_hard_general_register_operand for all patterns. > * config/arm/ldmstm.md: Regenerate. > * gcc/config/arm/arm.md: Use vfp_hard_register_operand in > vfp_pop_multiple_with_writeback. This needs to name the pattern being modified (in brackets before the colon. You should delete the predicate arm_hard_register_operand if it's now no-longer being used. Don't forget the ChangeLog entry for that as well. > > > pr59142-v1.diff > > > Index: gcc/config/arm/predicates.md > =================================================================== > --- gcc/config/arm/predicates.md (revision 205021) > +++ gcc/config/arm/predicates.md (working copy) > @@ -98,6 +105,15 @@ > && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS))); > }) > > +(define_predicate "vfp_hard_register_operand" > + (match_code "reg") > +{ > + return (REGNO_REG_CLASS (REGNO (op)) == VFP_D0_D7_REGS > + || REGNO_REG_CLASS (REGNO (op)) == VFP_LO_REGS > + || (TARGET_VFPD32 > + && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS)); > +}) No need to use REGNO_REG_CLASS, something like: IS_VFP_REGNUM (REGNO (op)) Should be sufficient. R.