On Fri, Jan 22, 2016 at 1:00 PM, Jan Hubicka <hubi...@ucw.cz> wrote: >> > 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.
That might work (same for -fexceptions). You might want to wrap the function in a ERT_MUST_NOT_THROW though in that case. Richard. > Honza >> >> -- >> Eric Botcazou