https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82858
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> --- unsigned c; unsigned d = __builtin_add_overflow(a, b, &c)?-1:0; return c|d; gives the expected asm. Ideally phiopt would recognize a saturing add pattern, but we have nothing to model it in gimple. We could turn it into the branchless BIT_IOR form though. (the problem isn't with __builtin_add_overflow but with what comes afterwards)