https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117699
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > I think the problem is in peep2_find_free_register: > /* Don't use registers set or clobbered by the insn. */ > FOR_EACH_INSN_DEF (def, peep2_insn_data[from].insn) > SET_HARD_REG_BIT (live, DF_REF_REGNO (def)); > > This only sets the live info based on the regno here. > > > But it should be instead (with fixed formating): > ``` > /* Don't use registers set or clobbered by the insn. */ > FOR_EACH_INSN_DEF (def, peep2_insn_data[from].insn) > add_to_hard_reg_set (&live, GET_MODE (DF_REF_REAL_REG (def)), DF_REF_REGNO > (def)); > ``` > > This is similar to what is done in compute_regs_asm_clobbered (ira.cc). Note I didn't look into the previous emails which even pointed to this part of the code being wrong. But yes the above is the fix to the code. I don't have time to test the fix until January though. If you want you can take my fix and finish it up.