This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: should MEM tracking be able to optimize this?
On Nov 18, 2001, Zack Weinberg <zack@codesourcery.com> wrote:
> Hmm, okay, but I'm still pretty confident that dereferencing a pointer to
> &X.a[i] for i>=2048 is undefined, which is the important thing for this
> optimization.
Hmm, indeed, 6.5.6/#8 and #9 appear to support your view.
Which gives me an interesting insight about aliasing rules. Given:
struct foo { int x[N]; int y[N]; };
int f(struct foo *foo_p, int *z) {
int *x = foo_p->x;
int *y = foo_p->y;
At this point, x and z may alias each other, and y and z may alias
each other, but x and y may be assumed not to alias each other. Cool!
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me