This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] PATCH to simplify array base
On Mon, Jun 10, 2002 at 10:36:37PM +0100, Jason Merrill wrote:
> ...though we will eventually want dependence analysis to handle that sort
> of thing anyway, as code like
>
> type *p = array;
> while (elt = *p++)
> ...;
>
> is pretty common.
Another way to approach this is to canonicalize this (after
constant propagation) as
t0 = 0;
while (elt = array[t0++])
...;
which I'd expect to allow unrolling to produce nicer code.
I'd also expect most of this "pessimization" to be undone
by the later strength reduction pass.
r~