This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/77436] Incorrect constant result for summing loop inserted


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]