[Bug c/93031] Wish: When the underlying ISA does not force pointer alignment, option to make GCC not assume it

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 3 07:54:22 GMT 2021


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's still UB.  Note that GCC has for a _long_ time made this assumption - just
the places we take advantage of it have grown.

Note it would be _very_ difficult to provide a -fno-strict-alignment option
because we can't really make all data types unaligned since that would break
the ABI.  So instead we'd have to sprinkle flag_strict_alignment checks
all over the place so I'm very sure you won't get a "fixed" compiler and
you might get one that doesn't adhere to the platform ABI any more (in case
we put one flag_strict_alignment too many).


More information about the Gcc-bugs mailing list