On Mon, 2013-06-17 at 10:07 -0700, Steve Ellcey wrote: > I have a loop induction variable question involving post increment. > If I have this loop: > > [...]
> My question is is: why (and where) did ivopts decide to move the > post-increments above the usages in the first loop? In my case > (MIPS) the second loop generates better code for me then the first > loop and I would like to avoid the '-4' offsets that are used. > Ideally, one would think that GCC should generate the same code > for both of these loops but it does not. > Sorry for not having an answer. I got curious, because just yesterday I was looking at this one http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55190 and thought that this is related, although it doesn't seem to. I've tried the two functions of yours on SH and there it produces the same machine code with -O2. -O3 results in a call to memcpy, while -O3 -fno-tree-loop-distribute-patterns again results in the same code. Cheers, Oleg