> > No, the problem here is deciding whether we can inline a clone.
> > We look into DECL_STRUCT_FUNCTION that we can't.  The real fix is one
> > commented in:
> >
> >   /* Don't inline if the callee can throw non-call exceptions but the
> >      caller cannot.
> >      FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is
> > missing. Move the flag into cgraph node or mirror it in the inline summary.
> >  */
> 
> The irony being that I implemented the flag for the sake of LTO, based on 
> suggestions made on this list...  So why is STRUCT_FUNCTION missing now?

I noticed that, sorry it was also my ommision.

DECL_STRUCT_FUNCTION and function bodies are not load into WPA stage, only into
ltrans. This is how WHOPR is designed.

WPA stage is expected to work across cgraph/varpool and not look into the
bodies/initializers.  So this flag, as well as the optimization settings, needs
to be copied there. 

Since we do a lot of querries from codegen to this particular flag, I would
suggest to simply copy it into inline_summary and make inline_analyze_function
to copy it rather than moving it to place less convenient for the codegen.

Honza
> 
> > I plan to look into this before next release.  I would, for sure, welcome
> > Eric beating me. If he don't have time to do so, I think the patch is OK as
> > it is, since it improves the situation despite the fact that it won't fix
> > the same problem with WPA.
> 
> OK, I'll install the patch for now.
> 
> -- 
> Eric Botcazou

Reply via email to