[patch] Restore cross-language inlining into Ada

Jan Hubicka hubicka@ucw.cz
Fri Jan 22 12:00:00 GMT 2016


> > I only updated
> > -  /* 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.  */ -  else if (callee_fun &&
> > callee_fun->can_throw_non_call_exceptions -	   && !(caller_fun &&
> > caller_fun->can_throw_non_call_exceptions)) -    {
> > -      e->inline_failed = CIF_NON_CALL_EXCEPTIONS;
> > -      inlinable = false;
> > -    }
> > to actually work with LTO where callee_fun/caller_fun is not always
> > available (but sometimes, like when ICF requested the body or when we
> > merged profiles, it is).
> 
> No, that's not true.  Let's consider an Ada caller and a C callee.  With the 
> old code (mine as you remarked): caller_fun->can_throw_non_call_exceptions is 
> true and callee_fun->can_throw_non_call_exceptions is false, so the above test 
> is false and we can inline.  With the new code (yours): check_match is true 
> and opt_for_fn (callee->decl, flag_non_call_exceptions) is false, so we cannot 
> inline.

Hmm, I see now.  I wonder if we can also inline can_thorw_non_call_exceptions
to !can_throw_non_call_exceptions provied that we set the flag in
ipa-inline-transform.  That way we can inline Ada to C and the observation
about no EH regions should still hold.

Honza
> 
> -- 
> Eric Botcazou



More information about the Gcc-patches mailing list