This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More on c-gimplify.c:gimplify_decl_stmt


On Sun, Jun 06, 2004 at 09:42:57PM -0400, Richard Kenner wrote:
> Knowing that one reference is 1250 bytes from the start of A and another is
> 1572 bytes from the start of B doesn't say they can't alias.

If you know that the size of the reference is 8 bytes, or 100 bytes,
or whatever constant size the field is, it most certainly does.

> Saying that the first reference uses field F1 of a type and the second
> reference uses field F2 of that same type says they can't alias.

True, but only for structures (as opposed to unions or variant records).
And for structures, the offsets are unique.

> That's an important optimization (indeed, isn't it one that you added?).

Yes, because the field was easier to get at and store than the offset.

> As to loop optimization, you can easily have an array inside a record.  If all
> you see if a position into a record, it's a lot of work to deduce that it's
> an array index.

Not at all.  We've *got* a biased index -- the offset into the record.
We can strength reduce on offset 15+4*i just as easy as we can for [i].



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]