public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: marcus-shawcroft@arm.com,	richard.guenther@gmail.com,	pinskia@gmail.com
Subject: [Patch AArch64 2/2] Do not double-copy bytes in volatile struct operations
Date: Thu, 21 Aug 2014 10:34:00 -0000	[thread overview]
Message-ID: <1408617247-21558-2-git-send-email-james.greenhalgh@arm.com> (raw)
In-Reply-To: <1408617247-21558-1-git-send-email-james.greenhalgh@arm.com>

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]


Hi,

We also need to be careful in AArch64's movmem implementation, we
can't expand to our overlapping mode of operation.

Bootstrapped with no issues.

OK?

Thanks,
James

---

2014-08-21  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c (aarch64_expand_movmem): Fail if we
	have volatile operands.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Patch-AArch64-2-2-Do-not-double-copy-bytes-in-volati.patch --]
[-- Type: text/x-patch;  name=0002-Patch-AArch64-2-2-Do-not-double-copy-bytes-in-volati.patch, Size: 565 bytes --]

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 0f3c74b..56434bc 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -9741,6 +9741,10 @@ aarch64_expand_movmem (rtx *operands)
   if (!CONST_INT_P (operands[2]))
     return false;
 
+  /* We can't do anything smart if either of the operands are volatile.  */
+  if (MEM_VOLATILE_P (src) || MEM_VOLATILE_P (dst))
+    return false;
+
   n = UINTVAL (operands[2]);
 
   /* Try to keep the number of instructions low.  For cases below 16 bytes we

  reply	other threads:[~2014-08-21 10:34 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  8:50 [AArch64] Implement movmem for the benefit of inline memcpy James Greenhalgh
2014-06-06 10:39 ` Richard Earnshaw
2014-08-01  6:38 ` Andrew Pinski
2014-08-01  9:05   ` Richard Biener
2014-08-01  9:21 ` pinskia
2014-08-05  7:05   ` Andrew Pinski
2014-08-07 14:20     ` James Greenhalgh
2014-08-07 14:34       ` Richard Biener
2014-08-20  9:10         ` [Patch 1/2] Control SRA and IPA-SRA by a param rather than MOVE_RATIO James Greenhalgh
2014-08-20  9:10           ` [Patch AArch64 2/2] Wire up TARGET_DEFAULT_MAX_SCALARIZATION_SIZE James Greenhalgh
2014-08-20  9:21           ` [Patch 1/2] Control SRA and IPA-SRA by a param rather than MOVE_RATIO Richard Biener
2014-09-25 14:58             ` [Patch 0/4] " James Greenhalgh
2014-09-25 14:58               ` [Patch AArch64 4/4] Wire up New target hooks James Greenhalgh
2014-09-26 13:31                 ` James Greenhalgh
2014-09-25 14:58               ` [Patchv2 3/4] Control SRA and IPA-SRA by a param rather than MOVE_RATIO James Greenhalgh
2014-09-26  9:11                 ` Richard Biener
2014-10-01 16:38                   ` James Greenhalgh
2014-10-29 14:39                     ` James Greenhalgh
2014-10-31 10:58                       ` Richard Biener
2014-11-06 11:53                         ` [Patchv3] " James Greenhalgh
2014-11-06 14:10                           ` Richard Biener
2014-09-25 14:58               ` [Patch 1/4] Hookize MOVE_BY_PIECES_P, remove most uses of MOVE_RATIO James Greenhalgh
2014-09-25 15:09                 ` Steven Bosscher
2014-09-26  9:16                   ` Richard Biener
2014-10-29 10:45                 ` [Patch 0/6] Hookize MOVE_BY_PIECES_P James Greenhalgh
2014-10-29 10:47                   ` [Patch 1/6] Hookize MOVE_BY_PIECES_P, remove most uses of MOVE_RATIO James Greenhalgh
2014-10-29 12:29                     ` Matthew Fortune
2014-10-29 16:11                       ` James Greenhalgh
2014-10-31 15:09                         ` James Greenhalgh
2014-10-31 15:10                           ` [Patch 2/7 s390] Deprecate *_BY_PIECES_P, move to hookized version James Greenhalgh
2014-10-31 15:10                           ` [Patch 1/7] Hookize *_BY_PIECES_P James Greenhalgh
2014-10-31 21:08                             ` Jeff Law
2014-10-31 15:11                           ` [Patch 4/7 sh] Deprecate *_BY_PIECES_P, move to hookized version James Greenhalgh
2014-11-01 23:27                             ` Kaz Kojima
2014-10-31 15:11                           ` [Patch 3/7 arc] " James Greenhalgh
2014-11-04 12:08                             ` Joern Rennecke
2014-11-04 14:24                               ` James Greenhalgh
2014-11-04 16:20                                 ` Joern Rennecke
2014-10-31 15:12                           ` [Patch 5/7 mips] " James Greenhalgh
2014-10-31 15:16                           ` [Patch 6/7 AArch64] " James Greenhalgh
2014-10-31 15:34                           ` [Patch 7/7] Remove *_BY_PIECES_P James Greenhalgh
2014-10-29 10:49                   ` [Patch 2/6 s390] Deprecate MOVE_BY_PIECES_P, move to hookized version James Greenhalgh
2014-10-29 21:09                     ` Jeff Law
2014-10-29 10:50                   ` [Patch 4/6 sh] " James Greenhalgh
2014-10-29 21:10                     ` Jeff Law
2014-10-30  0:49                     ` Kaz Kojima
2014-10-29 10:50                   ` [Patch 3/6 arc] " James Greenhalgh
2014-10-29 21:10                     ` Jeff Law
2014-10-29 10:51                   ` [Patch 5/6 mips] " James Greenhalgh
2014-10-29 21:18                     ` Jeff Law
2014-10-29 10:53                   ` [Patch 6/6] Remove MOVE_BY_PIECES_P James Greenhalgh
2014-10-29 21:20                     ` Jeff Law
2014-09-25 14:58               ` [Patch 2/4] Hack out a use of MOVE_RATIO in tree-inline.c James Greenhalgh
2014-09-26  8:58                 ` Richard Biener
2014-08-21 10:34         ` [Patch 1/2] Don't put out a call to memcpy for volatile struct operations James Greenhalgh
2014-08-21 10:34           ` James Greenhalgh [this message]
2014-08-21 11:22           ` Richard Biener
2014-08-21 23:47             ` Mike Stump
2014-08-22 15:42               ` Joseph S. Myers
2014-08-22 17:33                 ` Mike Stump
2014-08-26  8:35               ` Richard Biener
2014-08-26 16:42                 ` Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408617247-21558-2-git-send-email-james.greenhalgh@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcus-shawcroft@arm.com \
    --cc=pinskia@gmail.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).