On Thu, May 12, 2011 at 10:09:42AM +0100, Hari Sandanagobalane wrote: > The REGNO_REG_CLASS is generally an array of size > FIRST_PSEUDO_REGISTER. So, the indexes go from 0 to > FIRST_PSEUDO_REGISTER-1.
That is true. > I think the ">=" condition is fine in that > case. Do you agree? That is wrong. It is perfectly fine to handle hard reg with regno (FIRST_PSEUDO_REGISTER - 1) if it has nregs 1, or hard reg with regno (FIRST_PSEUDO_REGISTER - 2) if it has nregs 1 or 2. The following loop starts with nregs--, therefore for hard_regno + nregs == FIRST_PSEUDO_REGISTER at the place of your test REGNO_REG_CLASS will be used in the loop for hard_regno + nregs - 1 down to hard_regno + 0. > > > >With this change, the patch is ok. Thanks for the patch. > > > >>+ { > >>+ SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j], > >>+ hard_regno); > >>+ continue; > >>+ } > >> pclass = ira_pressure_class_translate[REGNO_REG_CLASS > >>(hard_regno)]; > >> for (nregs-- ;nregs>= 0; nregs--) > >> if (((enum reg_class) pclass > > Jakub