https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86259
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This code is undefined. Try -fno-strict-aliasing . But that might not even cause the undefined code to be resolved to bring defined as you are accessing outside the bounds of an array.