Fix target/101934: aarch64 memset code creates unaligned stores for -mstrict-align
authorAndrew Pinski <apinski@marvell.com>
Tue, 31 Aug 2021 04:41:14 +0000 (04:41 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 1 Sep 2021 20:58:00 +0000 (20:58 +0000)
commita45786e9a31f995087d8cb42bc3a4fe06911e588
tree0e7553eb6a7b0825a66344ab1fbe69cde71d27de
parentc4d6dcacfca1b804504515496e6d9de176d7f51e
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.
gcc/config/aarch64/aarch64.c
gcc/testsuite/gcc.target/aarch64/memset-strict-align-1.c [new file with mode: 0644]