This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix memset recognition, paper over PR53346
On Fri, 18 May 2012, Andi Kleen wrote:
> Richard Guenther <rguenther@suse.de> writes:
>
> > In PR53346 we vectorize a simple memset loop very inefficiently.
> > But of course we should have detected this and transformed the
> > loop into a memset! Seems like we only do that if the original
> > loop does sth else than memset as well.
>
> Is there a way to turn this off?
-fno-tree-loop-distribute-patterns, it's enabled by default only at -O3.
> I know code written in the past who explicitely wrote memset as a loop
> because it couldn't deal with the optimizations optimized memsets do
> (like reordering or changing access granuality.
>
> One example is clearing something in memory mapped hardware registers.
>
> It would be good at least if this was not done for volatile.
I see it does it for volatile - that's clearly a bug that I'll address
shortly.
Richard.