From d405dc23021fee4b6e1cd30650e0168b29918f61 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sat, 7 Sep 2019 04:38:58 +0000 Subject: [PATCH] arm.c (arm_block_set_aligned_non_vect): Use gen_unaligned_storedi for 4-byte aligned addresses. 2019-09-07 Bernd Edlinger * config/arm/arm.c (arm_block_set_aligned_non_vect): Use gen_unaligned_storedi for 4-byte aligned addresses. testsuite: 2019-09-07 Bernd Edlinger * gcc.target/arm/pr91684.c: New test. From-SVN: r275483 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 5 ++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arm/pr91684.c | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/arm/pr91684.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46c1b50346e..c6925e2562a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-09-07 Bernd Edlinger + + * config/arm/arm.c (arm_block_set_aligned_non_vect): Use + gen_unaligned_storedi for 4-byte aligned addresses. + 2019-09-06 Jim Wilson * config/riscv/riscv.c (riscv_option_override): Revert 2019-08-30 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index eb8bf13414f..8576431a8ec 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -30352,7 +30352,10 @@ arm_block_set_aligned_non_vect (rtx dstbase, { addr = plus_constant (Pmode, dst, i); mem = adjust_automodify_address (dstbase, DImode, addr, i); - emit_move_insn (mem, reg); + if (MEM_ALIGN (mem) >= 2 * BITS_PER_WORD) + emit_move_insn (mem, reg); + else + emit_insn (gen_unaligned_storedi (mem, reg)); } } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c910555071f..c2e23be7e5f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-09-07 Bernd Edlinger + + * gcc.target/arm/pr91684.c: New test. + 2019-09-06 Ian Lance Taylor * go.test/test/fixedbugs/bug369.go: Update to match libgo update diff --git a/gcc/testsuite/gcc.target/arm/pr91684.c b/gcc/testsuite/gcc.target/arm/pr91684.c new file mode 100644 index 00000000000..619c30fac93 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr91684.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_ldrd_strd_ok } */ +/* { dg-options "-O3" } */ + +typedef struct { int a, b, c; } S; + +void g (S *s); +void bug1 (void) +{ + S s; + __builtin_memset (&s, 0, sizeof (S)); + g (&s); +} + +/* { dg-final { scan-assembler-times "strd" 1 } } */ -- 2.30.2