public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Eric Botcazou <ebotcazou@adacore.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch] Restore cross-language inlining into Ada
Date: Fri, 22 Jan 2016 12:33:00 -0000	[thread overview]
Message-ID: <CAFiYyc28ONN4=K3JKi88S8+biooJ62iy23jPvbiQTJEYaKUJ8Q@mail.gmail.com> (raw)
In-Reply-To: <20160122120036.GB98233@kam.mff.cuni.cz>

On Fri, Jan 22, 2016 at 1:00 PM, Jan Hubicka <hubicka@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

      parent reply	other threads:[~2016-01-22 12:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  8:32 Eric Botcazou
2016-01-20 11:34 ` Richard Biener
2016-01-21 14:13   ` Jan Hubicka
2016-01-21 14:14     ` Richard Biener
2016-01-21 14:20       ` Jan Hubicka
2016-01-22 11:06         ` Eric Botcazou
2016-01-22 11:30           ` Richard Biener
2016-01-22 10:53     ` Eric Botcazou
2016-01-22 12:00       ` Jan Hubicka
2016-01-22 12:06         ` Eric Botcazou
2016-01-22 12:12           ` Arnaud Charlet
2016-01-22 12:40             ` Eric Botcazou
2016-01-22 18:22               ` Jan Hubicka
2016-01-23  9:25                 ` Eric Botcazou
2016-01-23  9:51                   ` Arnaud Charlet
2016-01-23 12:34                   ` Duncan Sands
2016-01-22 12:33         ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc28ONN4=K3JKi88S8+biooJ62iy23jPvbiQTJEYaKUJ8Q@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).