Georg-Johann Lay <a...@gjlay.de> writes: > This patch is to avoid PR120423 and PR116389 on avr. > > The PRs are about paradoxical subregs, that ICE after old reload > as follows: > > For rtxes like (subreg:HI (QI) 0), the inner rtx may be reloaded to > (reg:QI 31) which is fine, but the paradoxical subreg will be > changed to (reg:HI 31) which is invalid since all hard regs that > hold more than one byte must start in an even register. > > Reload calls targetm.hard_regno_mode_ok on the QI reg several > times and in several places, but in no case it calls that hook > on the HImode register. Moreover, in struct reload there is > no information about it's a subreg, so there is no simple fix in > reload. > > The patch passes without new regressions on avr + v15. It is not > activated when LRA is on (-mlra). The PR120423 test cases generate > the same code with the patch like with -mlra, so the patch doesn not > even introduce some performance penalty. > > The patch is only for v15, though it still works with trunk. > I have no plans to apply it on trunk, but when you like to see it > on trunk, too, that is no problem. The patch is of course only in > lack of a better patch. > > Ok for v15?
Ok. Please apply. Denis.