On Thu, Oct 15, 2020 at 09:59:24AM +0100, Alex Coplan wrote: > Currently, make_extraction() identifies where we can emit an ASHIFT of > an extend in place of an extraction, but fails to make the corresponding > canonicalization/simplification when presented with a MULT by a power of > two. Such a representation is canonical when representing a left-shifted > address inside a MEM. > > This patch remedies this situation: after the patch, make_extraction() > now also identifies RTXs such as: > > (mult:DI (subreg:DI (reg:SI r)) (const_int 2^n)) > > and rewrites this as: > > (mult:DI (sign_extend:DI (reg:SI r)) (const_int 2^n)) > > instead of using a sign_extract.
That is only correct if SUBREG_PROMOTED_VAR_P is true and SUBREG_PROMOTED_UNSIGNED_P is false for r. Is that guaranteed to be true here (and how then?) Segher