https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63412
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- https://gcc.gnu.org/bugs/ "Similarly, if compiling with -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations makes a difference, your code probably is not correct." Turning off strict aliasing stops it crashing => you broke the aliasing rules