> > Then you should document that by stating that the pattern is guaranteed > > to be invoked only for addresses (and may not clobber the condition > > code). > Ok, will do.
Thanks. > > Hoping isn't sufficient IMO here, you need to rename/rework > > emit_add3_insn and possibly stop the compiler if the value it is > > invoked on is not an address. > Agreed. Any idea how to check for this? The head comment of lra_emit_add appears to be saying that it is invoked only for addresses; it's clear when it is invoked from base_plus_disp_to_reg but it's less clear when it is invoked from lra_emit_move. So a possible approach could be to split lra_emit_move into 2 parts: lra_emit_move with an assertion that y isn't a PLUS and lra_emit_address_move with the call to lra_emit_add, and review all the callers. If that's too much work, just copy (part of) the head comment of lra_emit_add to that of emit_add3_insn and cross your fingers (yes, the latter action adds something over just hoping :-) -- Eric Botcazou