https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65317
--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> --- It seems this is a general problem. Combine would sometimes synthesize and try to introduce new constants. But because most of the SH insn patterns reject general constants (e.g. arith_reg_operand) combine fails. In PR 67391, the addsi3 patterns have been extended to support arbitrary constants and it resulted in quite some code size improvements. So probably the same strategy should be applied to other patterns such as addc (e.g. PR 52628), logical and,or,xor etc. Constants which are introduced during combine have to be split out and optimized further (constant sharing or calculation) in a separate pass.