On Mon, Nov 7, 2022 at 12:52 PM Vladimir Makarov <vmaka...@redhat.com> wrote: > even better patch: > > diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc > index 4a1a325e8e3..ffe73b61c45 100644 > --- a/gcc/ira-color.cc > +++ b/gcc/ira-color.cc > @@ -2209,8 +2209,8 @@ assign_hard_reg (ira_allocno_t a, bool retry_p) > restore_costs_from_copies (a); > ALLOCNO_HARD_REGNO (a) = best_hard_regno; > ALLOCNO_ASSIGNED_P (a) = true; > - if (best_hard_regno >= 0) > - update_costs_from_copies (a, true, ! retry_p); > + if (best_hard_regno >= 0 && !retry_p) > + update_costs_from_copies (a, true, true); > ira_assert (ALLOCNO_CLASS (a) == aclass); > /* We don't need updated costs anymore. */ > ira_free_allocno_updated_costs (a); > ... > Please, check that my proposed patch works and commit it in the case of > success.
Thank you for taking a look and suggesting a better fix. I've tested your version for target=xtensa-linux-uclibc, it fixes the issue without new regressions. I've committed the fix to the master branch and will backport it to gcc-10, -11 and -12 in a few days. -- Thanks. -- Max