This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa]: GIMPLE lowering array references too early?
- From: law at redhat dot com
- To: Chris Lattner <sabre at nondot dot org>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, gcc at gcc dot gnu dot org, jason at redhat dot com, dnovillo at redhat dot com
- Date: Tue, 29 Jul 2003 12:23:27 -0600
- Subject: Re: [tree-ssa]: GIMPLE lowering array references too early?
- Reply-to: law at redhat dot com
In message <Pine.LNX.email@example.com>, Chris Lattner
>On Tue, 29 Jul 2003 firstname.lastname@example.org wrote:
>> >Would this break everything?
>> It's a source of annoyance. I had started cobbling together some code to
>> do this, but things kept breaking downstream. Probably due to my lack of
>> knowledge about reform the ARRAY_REFs/ARRAY_TYPEs.
>I have done a fair amount of work in the past trying to reconstruct array
>references from "lowered" address arithmetic like this, and have come to
>the conclusion that there is no good way to do it in general.
Note that I was not trying to reconstruct array notation from pointer
notation, but trying to keep the compiler from dropping the already existing
array notation down to pointer notation.
For something like this:
for (i = 0; i < 10; i++)
For code of that style the compiler lowers to pointer notation as it's
generating the tree IL. It'd be *far* better if it kept the existing
array notation for this case. We have the toplevel object (a pointer)
and an index, rather than generating pointer code we should be generating
a suitable ARRAY_REF.
>Given the right people working on the problem, and enough interest, do you
>think it's possible to "fix it right" in the places that break downstream?
More likely the solution is actually generate the correct ARRAY_REF/ARRAY_TYPE
structures to begin with. As I said, I'm pretty sure the failures where
me simply generating the wrong tree nodes.