https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66373
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You should try valgrind on the program, compile/link with -fsanitize=address,undefined and see what it reports during runtime, try different compiler options. If you then still suspect a compiler bug, please try to turn your program into a self-contained reproducer, see http://gcc.gnu.org/bugs/ for details.