https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83456

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=32667

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
See also bug 32667 for some background into GCC emitting perfectly overlapping
calls to memcpy for some aggregate assignments.  The code that controls the
diagnostic tries to work around that bug:

  /* If SRC and DEST are the same (and not volatile), return
     DEST{,+LEN,+LEN-1}.  */
  if (operand_equal_p (src, dest, 0))
    {
      /* Avoid diagnosing exact overlap in calls to __builtin_memcpy.
         It's safe and may even be emitted by GCC itself (see bug
         32667).  However, diagnose it in explicit calls to the memcpy
         function.  */
      if (check_overlap && *IDENTIFIER_POINTER (DECL_NAME (func)) != '_')
        warning_at (loc, OPT_Wrestrict,
                    "%qD source argument is the same as destination",
                    func);

Reply via email to