This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc.c-torture/unsorted/pass.c: what is it supposed to test?
- From: law at redhat dot com
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: "Joseph S. Myers" <jsm at polyomino dot org dot uk>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Fri, 27 Feb 2004 11:17:39 -0700
- Subject: Re: gcc.c-torture/unsorted/pass.c: what is it supposed to test?
- Reply-to: law at redhat dot com
In message <1077904326.15336.75.camel@localhost.localdomain>, Diego Novillo wri
tes:
>Thanks. Hmm, I think we will need to represent intptr_t as pointers in
>GIMPLE. All our alias analysis hinges on POINTER_TYPE_P returning
>nonzero. Jason, thoughts?
Why do you think we need to represent intptr_t as a pointer in gimple?
IMHO, that would actually be a step backwards.
The only way we're going to get these things is when we have a cast of
this nature (integer to pointer). Such casts can only occur on the
RHS of a MODIFY_EXPR node and are easily identified.
To do anything "bad" with such a node it would have to be casted back to
a pointer, then dereferenced. If that happens then I'm pretty sure all
the right things would happen.
So it seems to me that we merely need to note which pointer variables are
casted into integers (easy to identify during one of our IL scans) and
just mark the objects that the pointer may point to as call-clobbered. That's
a little over-conservative, but should "DTRT".
jeff