[Bug c/77436] Incorrect constant result for summing loop inserted
gcc-bugzilla at lucaswerkmeister dot de
gcc-bugzilla@gcc.gnu.org
Wed Aug 31 22:03:00 GMT 2016
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).
More information about the Gcc-bugs
mailing list