[Bug c/102279] Bad codegen with ILP32, packed struct field pointer, static variable
rearnsha at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 10 16:14:36 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102279
--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Looks to me like this code violates the aliasing rules. Compiling with
-fno-strict-aliasing looks generate what your are expecting (although your
expectations are wrong by the C standard).
Oddly, -Wstrict-aliasing does not pick this case up, perhaps because of the
packed attribute.
More information about the Gcc-bugs
mailing list