This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Canonicalising truncated shift counts
> I don't think that'd be the right approach. It seems odd for
> simplify_binary_operand to return null for a pair of operands
> if simplify_gen_subreg would keep one operand and change the
> value of the other. This canonicalisation seems more in the
> spirit of things like
>
> (minus ... (const_int X)) -> (plus ... (const_int -X))
> and (mult ... (const_int 2<<X)) -> (ashift ... (const_int X))
>
> (especially the first).
Agreed. Patch is OK if you rename the label to 'canonicalize_*' and put the
new code either after the first affected case or the last affected case.
--
Eric Botcazou