This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: IMA vs tree-ssa
- From: Dale Johannesen <dalej at apple dot com>
- To: Geoff Keating <geoffk at desire dot geoffk dot org>
- Cc: neil at daikokuya dot co dot uk, rth at redhat dot com, gcc at gcc dot gnu dot org, Dale Johannesen <dalej at apple dot com>, gdr at integrable-solutions dot net, mark at codesourcery dot com
- Date: Fri, 2 Apr 2004 11:42:45 -0800
- Subject: Re: IMA vs tree-ssa
- References: <F0209661-68A9-11D8-8C0E-000A95D7CD40@apple.com> <20040226230842.GA28463@redhat.com> <jmwu698lfu.fsf@desire.geoffk.org> <20040227211712.GB16448@daikokuya.co.uk> <jmoerk8ae8.fsf@desire.geoffk.org> <20040227220212.GC16448@daikokuya.co.uk> <404CF3C5.4070803@codesourcery.com> <m3n06rlzgj.fsf@uniton.integrable-solutions.net> <20040308153208.A23517@synopsys.com> <61884C8A-715D-11D8-87F8-000A95D7CD40@apple.com> <jmad1v2p4h.fsf@desire.geoffk.org> <37619788-8440-11D8-8F7D-000A95D7CD40@apple.com> <200404021818.i32IIPve000486@desire.geoffk.org>
On Apr 2, 2004, at 10:18 AM, Geoff Keating wrote:
Restricting p and q to be non-char, it does; *p and *q have
non-compatible types.
They have non-compatible types with each other, but that's not the
test for whether two things can't alias; the standard talks about the
'effective type of the object'. So two accesses can alias if there
could be a type which is compatible with both of the types involved,
even if the two types are not themselves compatible. If you can work
out what the object's effective type is (which is not always possible
at compile time, since it's a run-time property) then you could test
for compatibility with that, which would be a more precise test.
OK, I believe that. Then what we have is a bug. Do you agree the
following is standard-conforming? It gets different results with
different
options on ppc; the pointer derefs in foo have different alias classes,
and the scheduler does not find a dependency between them.
unsigned int a, b;
enum e1 { x, y, z };
enum e2 {t,u,v};
void foo (enum e1* e1p, enum e2* e2p, int x)
{ *e1p = x;
b = *e2p; }
main() {
enum e1* e1p = (enum e1*) &a;
enum e2* e2p = (enum e2*) &a;
foo (e1p, e2p, 3);
printf("%d\n", b);
}