https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109052
--- Comment #6 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Uroš Bizjak from comment #5) > (In reply to Vladimir Makarov from comment #4) > > > So I think the current patch is probably an adequate solution. > > Perhaps the compiler should also try to swap input operands to fit the > combined insn when commutative operands are allowed. This would solve the > testcase from Comment #2: > Yes. I am agree. The base code can be improved further. Another improvement could be combining secondary memory reload for output. I'd like to watch what the effect of the current patch would be first. Although I tested the patch on many targets as usually for LRA the patch might result in some troubles on some targets. But I hope nothing bad will happen.