https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116677
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- GCC doesn't implement the "common initial sequence rule", so I think you need to use -fno-strict-aliasing; struct sockaddr_storage and struct sockaddr_in are not compatible with GCCs TBAA rules.