https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93990
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW Severity|normal |enhancement --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- _addcarry_u64(0, a, c, &result0) can definitely be folded into __builtin_uadd_overflowll/.ADD_OVERFLOW without any troubles. The second _addcarry_u64 here since the result is not used can be folded into just an a few adds. That leaves if there case where the first argument is non-zero and the result is used. I think going the route that Jakub mentions is best for this last case.