https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68840
--- Comment #1 from Mikael Pettersson <mikpelinux at gmail dot com> --- Your program invokes undefined behaviour by running off the end of that array. Your loop termination condition is off by one. It's also the wrong way around: you must check the index before indexing the array with it.