Cleanup handling of local/readonly memory in modref and ipa-pure-const
Richard Biener
richard.guenther@gmail.com
Wed Sep 23 12:35:00 GMT 2020
On Wed, Sep 23, 2020 at 2:32 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > On Wed, Sep 23, 2020 at 11:55 AM Jan Hubicka <hubicka@ucw.cz> wrote:
> > >
> > > > > +/* Return true if T is a pointer pointing to memory location that is local
> > > > > + for the function (that means, dead after return) or read-only. */
> > > > > +
> > > > > +bool
> > > > > +points_to_local_or_readonly_memory_p (tree t)
> > > > > +{
> > > > > + /*if (!POINTER_TYPE_P (TREE_TYPE (t)))
> > > > > + return false; */
> > > >
> > > > remove ^^^
> > > Ahh, sorry.
> > > >
> > > > > + STRIP_NOPS (t);
> > > >
> > > > This wasn't in the original code - did you really run into (long)&x or what?
> > >
> > > Old code works on references only. In the followup I want to run it on
> > > function arguments, so we can propagate info that i.e. this pointer
> > > passed to function points to automatic variable.
> > >
> > > I think I can see nops in the gimple args so I should strip it?
> >
> > No, there cannot be conversions in gimple args.
>
> I will re-test with the strip dropped. OK with that change?
Yes (and the commented check removed)
Richard.
> Honza
> >
> > > I did not verify if that happens in pratice.
> > >
> > > Honza
More information about the Gcc-patches
mailing list