https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67317
--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> --- Combine can handle most RTL expressions, although it sometimes simplifies (or "simplifies") more than you want. I think in this case what is already done in *add<mode>3_cc_overflow will work well, but I do not know x86 CC modes terribly well. You'll need to experiment a bit to find something that works well in all interesting cases.