https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93302
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Use either -fno-strict-aliasing, memcpy or an union to fix the aliasing issue in your code. You wrote hdr as a struct psuedo_hdr but reading it as an uint16_t, only the field length can be read as an uint16_t .