arm.c (arm_block_set_aligned_non_vect): Use gen_unaligned_storedi for 4-byte aligned...
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 7 Sep 2019 04:38:58 +0000 (04:38 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Sat, 7 Sep 2019 04:38:58 +0000 (04:38 +0000)
2019-09-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * 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  <bernd.edlinger@hotmail.de>

        * gcc.target/arm/pr91684.c: New test.

From-SVN: r275483

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr91684.c [new file with mode: 0644]

index 46c1b50346e5487f7876d5a886e05567e187f053..c6925e2562a2e7228f0a15e1f833e71b2e19a1fc 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * config/arm/arm.c (arm_block_set_aligned_non_vect): Use
+       gen_unaligned_storedi for 4-byte aligned addresses.
+
 2019-09-06  Jim Wilson  <jimw@sifive.com>
 
        * config/riscv/riscv.c (riscv_option_override): Revert 2019-08-30
index eb8bf13414fdf5f411deed9110cc28921153f7d4..8576431a8ecebb44abff0ceb4ff6f8596b782739 100644 (file)
@@ -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
index c910555071fd745cbc3c0bff51e88f0dee710829..c2e23be7e5f1e22e912367a033c0c9163c68fe3c 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * gcc.target/arm/pr91684.c: New test.
+
 2019-09-06  Ian Lance Taylor  <iant@golang.org>
 
        * 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 (file)
index 0000000..619c30f
--- /dev/null
@@ -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 } } */