This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Function annotations for noclobber/noescape arguments
On Tue, 6 Apr 2010, Jan Hubicka wrote:
> > On Tue, 6 Apr 2010, Jan Hubicka wrote:
> >
> > > >
> > > > This is a heads-up and request for comments. I plan on going forward
> > > > with http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01026.html,
> > > > http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01027.html and
> > > > http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01257.html
> > > > next week (after updating the patches and re-testing them).
> > > >
> > > > I expect that for example the Fortran folks want to annotate their
> > > > runtime library API with such information.
> > >
> > > Also C++ library should get the annotations. We probably also want
> > > to decide what to do about the -Wattribute-* warnings. Last time
> > > discussion died on various details without a conclussion, I will
> > > post updated patch.
> > >
> > > Is there way to annotate the "this" pointer of C++ methods?
> >
> > Yes, like other attributes arguments include the "this" pointer,
> > so annotating argument i for foo in
> >
> > class X { void foo(char *p); };
> >
> > requires for example __attribute__((fnspec("..r"))).
>
> ... hmm and this for sure will require updating in ipa-sra and clonning ;)
> I guess other parameter wide attributes we have are safe here since we process
> them fully before early optimizations, right?
Hmm. I guess we are just lucky that usually bodies are not available
for functions with annotated args. Thus the easiest fix is to simply
disregard the fnspec attribute in that case (or even throw it away).
There's more detailed information available in that case anyway.
Richard.