This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples] dereference POINTER_PLUS_EXPR check
On Wed, Nov 21, 2007 at 10:57:30PM +0100, Richard Guenther wrote:
> On Nov 21, 2007 10:52 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
> > > Maybe we could make this a helper in tree.c. Something like
> > > pointed_to_type(). I don't think one exists already, but I may be wrong.
> >
> > Things are a bit cleaner now too, bonus!
> >
> > Is this OK?
>
> No, sorry. It doesn't make sense to check the pointed-to types. Or do you
> say the modify expr embeds a de-reference?
The modify_expr now embeds a POINTER_PLUS_EXPR.
Where previously we had:
(MODIFY_EXPR lhs (POINTER_PLUS_EXPR rhs1 rhs2))
We now have:
(GIMPLE_ASSIGN lhs rhs1 rhs2)
with the POINTER_PLUS_EXPR in the subcode of the GIMPLE_ASSIGN. We have
collapsed the MODIFY_EXPR and the POINTER_PLUS_EXPR nodes into one
tuple.
Previously, we would verify type sanity by checking the type of the LHS
(which should be a pointer) with the type of the P_P_E. We no longer
have the P_P_E with its type, so now we must look at the pointed-to
types of both lhs and rhs1.
Why do you think it doesn't make sense to look at the pointed-to types?
Aldy