[Bug c++/103699] Reading or writing a constant unaligned value is wrongly optimized causing an incorrect result (GCC-11 and up)

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 14 12:57:05 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103699

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
There is -Wstrict-aliasing warning, with 3 different levels from most to least
aggressive, see gcc documentation.  But that warns mostly on the casts rather
than when performing the invalid access.  There are plans for a strict aliasing
sanitizer, but it is a lot of work and hard to do right.


More information about the Gcc-bugs mailing list