https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113982
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- We pattern recognize just something like (or r < y): add_result add_wide_3(unsigned long long x, unsigned long long y) { auto r = x + y; return add_result{r, r < x}; } and not doing the addition uselessly in twice as big mode + shift + comparison against 0. The reason for mov edx, 0 is not to clobber flags which are live at that point, of course one could also move the clearing of edx one insn earlier and then it could be xor edx, edx.