public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] tree-optimization/108691 - indirect calls to setjmp
Date: Mon, 13 Feb 2023 12:14:21 +0100	[thread overview]
Message-ID: <Y+objaydruyzhDW5@tucnak> (raw)
In-Reply-To: <20230213110058.0C9B61391B@imap2.suse-dmz.suse.de>

On Mon, Feb 13, 2023 at 12:00:56PM +0100, Richard Biener wrote:
> DCE now chokes on indirect setjmp calls becoming direct because
> that exposes them too late to be subject to abnormal edge creation.
> The following patch honors gimple_call_ctrl_altering for those and
> _not_ treat formerly indirect calls to setjmp as calls to setjmp.
> 
> Unfortunately there's no way to have an indirect call to setjmp
> properly annotated (the returns_twice attribute is ignored on types).
> 
> RTL expansion late discovers returns-twice for the purpose of
> adding REG_SETJMP notes and also sets ->calls_setjmp
> (instead of asserting it is set).  There's no good way to
> transfer proper knowledge around here so I'm using ->calls_setjmp
> as a flag to indicate whether gimple_call_ctrl_altering was set.
> 
> Comments on what's the most sensible thing to do here?  Supporting
> returns_twice on indirect calls wouldn't be difficult, so we're
> talking about how to handle this kind of "legacy" situation?

One thing is supporting returns_twice on function types, but another one
is that initially none of the calls will be marked that way and even later,
it is up to the user if they mark it or not.

Could we e.g. prevent turning such indirect calls into direct calls?

Anyway, notice_special_calls is called in various spots, not just DCE,
wouldn't it be better to simply not set calls_setjmp flag in there if
the current function already has cfg and the call isn't ctrl altering?

	Jakub


  reply	other threads:[~2023-02-13 11:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 11:00 Richard Biener
2023-02-13 11:14 ` Jakub Jelinek [this message]
2023-02-13 12:41   ` Richard Biener
2023-02-13 12:46     ` Jakub Jelinek
2023-02-13 13:18       ` Richard Biener

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=Y+objaydruyzhDW5@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).