https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101934
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:f00530266f89b28e8286cdd2f587e046a27d2193 commit r11-9001-gf00530266f89b28e8286cdd2f587e046a27d2193 Author: Andrew Pinski <apin...@marvell.com> Date: Tue Aug 31 04:41:14 2021 +0000 Fix target/101934: aarch64 memset code creates unaligned stores for -mstrict-align The problem here is the aarch64_expand_setmem code did not check STRICT_ALIGNMENT if it is creating an overlapping store. This patch adds that check and the testcase works. gcc/ChangeLog: PR target/101934 * config/aarch64/aarch64.c (aarch64_expand_setmem): Check STRICT_ALIGNMENT before creating an overlapping store. gcc/testsuite/ChangeLog: PR target/101934 * gcc.target/aarch64/memset-strict-align-1.c: New test. (cherry picked from commit a45786e9a31f995087d8cb42bc3a4fe06911e588)