https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120254
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #2) > gcc -fsanitize=undefined -o pr120254{,.c}; ./pr120254 > pr120254.c:20:32: runtime error: signed integer overflow: -804068425 + > -2004610352 cannot be represented in type 'int' > Resulting sum of array A: > pr120254.c:31:23: runtime error: signed integer overflow: 2112539415 + > 126566608 cannot be represented in type 'int' > -1957771396 But note if we use -fwrapv or change the types to unsigned we still get the same incorrect behavior.