This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] propagate malloc attribute in ipa-pure-const pass
> > struct D: B {
> > char buf[32];
> > virtual void* f (unsigned n) {
> > if (n < 32)
> > return n <= 32 ? buf : B::f (n);
> > }
> >
> > Breaking foo's attribute malloc constraint.
> >
> > In other words, I think virtual functions need to be excluded
> > from the list (unless they're defined in a class marked final,
> > or unless we know they're not overridden to break the constraint
> > like above).
>
> But we are annotating the actual decl, not the type in the class
> struct.
Yep and we will be able to use the information in case we devirtualize
the call. So this seems OK to me.
Honza
>
> Richard.