Re: [PATCH] Fix PR54132

2012-09-19 Thread Jakub Jelinek
On Wed, Sep 19, 2012 at 10:53:00AM +0200, Richard Guenther wrote: > + extern void abort (void); > + void foo(char *p, int n) > + { > + int i; > + for (i = 1; i < n; i++) > + p[i] = p[i - 1]; You could turn this into if (n > 1) memset (p + 1, p[0], n - 1); if you wanted, though of course th

[PATCH] Fix PR54132

2012-09-19 Thread Richard Guenther
This fixes PR54132 where loop distribution pattern matching thinks that every loop that copies contiguous memory regions and has a dependence between input and output can be representet by a memmove. Not. Obviously. Thus, fixed by doing proper dependence checks. Bootstrapped and tested on x86_6