On Tue, Aug 20, 2019 at 04:20:03PM +0200, Jose E. Marchesi wrote: > > + (PLUS ADDR_BASE CONST_INT) > > + (PLUS CONST_INT ADDR_BASE) > > The second one isn't canonical rtl, so you shouldn't (need to) handle it. > Please raise a bug if you find a case where it's being generated. :-) > > Oooh, didn't know that, that's actually very handy :) > > Do you know if this is documented anywhere? I don't recall seeing this > in the internals manual, but maybe I missed it.
@node Insn Canonicalizations ... @itemize @bullet @item For commutative and comparison operators, a constant is always made the second operand. If a machine only supports a constant as the second operand, only patterns that match a constant in the second operand need be supplied. The whole section is worth reading :-) Segher