https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119441
--- Comment #1 from Nikolay Nechaev <n.nechaev at omp dot ru> --- Here are a few other findings: * If `buf5` is initialized with any non-zero value, the bug disappears * If `func` has the attribute `__attribute__((optimize("-fno-tree-slp- vectorize")))`, the bug disappears * If `func` has the attribute `__attribute__((optimize("-fno-tree-ter")))`, the bug disappears * If the option `-O1` is removed from the command line but all the enabled flags from `g++ -O1 -Q --help=optimizers` are added instead, the bug disappears Thus, as far as I can tell, the bug is only there if both `tree-ter` and `tree-slp-vectorize` are enabled together with an optimization from `-O1` that doesn't have its own flag.