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
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Jun 2002 18:02:35 -0400 (EDT)
- Subject: Re: [ast-optimizer-branch] PATCH to simplify array base
On Mon, 10 Jun 2002, Richard Henderson wrote:
> On Sat, Jun 08, 2002 at 07:04:04AM +0100, Jason Merrill wrote:
> > We haven't been simplifying array bases, but we should. Given an
> > expression like k.d[2][3] where k.d is of type int[3][4], this will now
> > simplify to
> >
> > int (*t1)[3][4];
> > int t2;
> > t1 = &k.d;
> > t2 = (*t1)[2][3];
>
> I think this is wrong. The only reason not to decompose all array
> arithmetic to pointer arithmetic immediately is to make it easier
> for dependence analysis to do its job. Given this is the case, your
> change hamstrings dependence analysis, requiring that it search
> backward for whatever t1 references.
Err, not really.
The IVR algorithm that we are planning on using does forward
substitution as an integral part of the algorithm, so saying it
"hamstrings" dependence analysis is not quite right.
By the time dependence analysis runs, it won't see it.
--Dan