https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116413
Richard Sandiford <rsandifo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #9 from Richard Sandiford <rsandifo at gcc dot gnu.org> --- (In reply to Michael Matz from comment #8) > Yeah, reload doesn't expect ASHIFTs within operands here. The below would > fix > that: > > diff --git a/gcc/final.cc b/gcc/final.cc > index eb9e065d9f0..5d911586de5 100644 > --- a/gcc/final.cc > +++ b/gcc/final.cc > @@ -3146,6 +3146,7 @@ walk_alter_subreg (rtx *xp, bool *changed) > case PLUS: > case MULT: > case AND: > + case ASHIFT: > XEXP (x, 0) = walk_alter_subreg (&XEXP (x, 0), changed); > XEXP (x, 1) = walk_alter_subreg (&XEXP (x, 1), changed); > break; LGTM FWIW. The different canonicalisation rules around ASHIFT/MULT in memories vs outside memories is an unfortunate wart, but what LRA is doing for lea is the correct behaviour.