The following amends the cpymem documentation to mention that exact
overlap needs to be handled gracefully, also noting that the target
runtime is expected to behave the same way.

OK?

Thanks,
Richard.

        PR middle-end/32667
        * md.texi (cpymem): Document that exact overlap of source
        and destination needs to work.  Mention the target runtime
        may not treat this case as undefined.
---
 gcc/doc/md.texi | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index df6725ffc9c..8743b393b3c 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -6915,8 +6915,11 @@ individually copied data units in the block.
 
 The @code{cpymem@var{m}} patterns need not give special consideration
 to the possibility that the source and destination strings might
-overlap. These patterns are used to do inline expansion of
-@code{__builtin_memcpy}.
+overlap.  An exeption is the case where source and destination are
+equal.  These patterns are used to do inline expansion of
+@code{__builtin_memcpy}.  The target runtime is expected to handle
+the case of an exact overlap of source and destination gracefully
+as GCC does not consider that undefined behavior.
 
 @cindex @code{movmem@var{m}} instruction pattern
 @item @samp{movmem@var{m}}
-- 
2.35.3

Reply via email to