https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77436
--- Comment #3 from Lucas Werkmeister <gcc-bugzilla at lucaswerkmeister dot de> --- Sorry, I wasn’t aware that wrapping is defined but overflow isn’t. The bug also happens if the summand type is changed to long (or, precisely, int64_t), where overflow shouldn’t happen (we’re adding at most 2^31 integers with the same sign, each of which doesn’t exceed 2^31 in magnitude, so 2^63 should be enough for the sum).