https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66230
--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Another thing you might try is to use: -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations (as per http://gcc.gnu.org/bugs/) and see if the issue goes away, too.