https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88359
--- Comment #5 from Geert linders <geert.linders at hotmail dot com> --- Workaround 2: add the following in front of the offending function: #pragma GCC optimize("no-move-loop-invariants") This has the advantage that it only affects the offending function and not the rest of the source file(s).