https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103699
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-14 Ever confirmed|0 |1 Status|UNCONFIRMED |WAITING --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- On x86_64 the memory model is such that the unaligned loads are fine always. If you don't want/need to do the load as not unaligned on x86 you need to use volatile instead. The testcase below gives the same results even on clang, there are no loads left. So you need to provide the testcase which is failing for you and on the specific target which is failing for you. For an example on aarch64, you might want to use -mstrict-align if you have code which requires unaligned access to not go through the wider load/stores (there is at least a bug there with respect to memset in GCC 11 and on the trunk but it is in the process of being fixed).