On Wed, Mar 7, 2018 at 3:01 PM, Martin Sebor <mse...@gmail.com> wrote:
> I have become convinced that issuing -Wrestrict in gimple-fold
> for calls to memcpy() where the source pointer is the same as
> the destination causes more trouble than it's worth, especially
> when inlining is involved, as in:
>
>   inline void bar (void *d, void *s, unsigned N)
>   {
>     if (s != d)
>       memcpy (d, s, N);
>   }
>
>   void foo (void* src)
>   {
>     bar (src, src, 1);
>   }
>
> It seems that there should be a way to teach GCC to avoid
> folding statements in dead blocks (e.g., in a block controlled
> by 'if (0 != 0)' as the one below), and that it might even speed
> up compilation, but in the meantime it leads to false positive
> -Wrestrict warnings.
>
> The attached patch removes this instance of the warning and
> adjusts tests not to expect it.

This caused:

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


-- 
H.J.

Reply via email to