public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108691] [13 Regression] ICE with function ptr and setjmp/returns twice at -O1
Date: Mon, 13 Feb 2023 14:57:32 +0000	[thread overview]
Message-ID: <bug-108691-4-YHZNQ6nbnF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108691-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108691

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:6436add49ed9ecf74f1f01b4fe18961df4f3e83d

commit r13-5965-g6436add49ed9ecf74f1f01b4fe18961df4f3e83d
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Feb 13 10:41:51 2023 +0100

    tree-optimization/108691 - indirect calls to setjmp

    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
    in notice_special_calls.

    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_p was set.

            PR tree-optimization/108691
            * tree-cfg.cc (notice_special_calls): When the CFG is built
            honor gimple_call_ctrl_altering_p.
            * cfgexpand.cc (expand_call_stmt): Clear cfun->calls_setjmp
            temporarily if the call is not control-altering.
            * calls.cc (emit_call_1): Do not add REG_SETJMP if
            cfun->calls_setjmp is not set.  Do not alter cfun->calls_setjmp.

            * gcc.dg/pr108691.c: New testcase.

  parent reply	other threads:[~2023-02-13 14:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 10:04 [Bug c/108691] New: ICE when compiling for AArch64 with BTI protection " david.spickett at linaro dot org
2023-02-07 10:06 ` [Bug c/108691] " david.spickett at linaro dot org
2023-02-07 10:16 ` [Bug tree-optimization/108691] ICE with function ptr and setjmp/returns twice " pinskia at gcc dot gnu.org
2023-02-07 10:17 ` [Bug tree-optimization/108691] [13 Regression] " pinskia at gcc dot gnu.org
2023-02-07 10:17 ` pinskia at gcc dot gnu.org
2023-02-07 10:21 ` pinskia at gcc dot gnu.org
2023-02-07 14:07 ` rguenth at gcc dot gnu.org
2023-02-13  9:34 ` rguenth at gcc dot gnu.org
2023-02-13  9:51 ` david.spickett at linaro dot org
2023-02-13 10:01 ` rguenth at gcc dot gnu.org
2023-02-13 14:57 ` cvs-commit at gcc dot gnu.org [this message]
2023-02-13 14:58 ` rguenth at gcc dot gnu.org
2023-02-15  8:19 ` david.spickett at linaro dot org
2023-02-21  9:27 ` rguenth at gcc dot gnu.org
2023-02-21  9:50 ` sam at gentoo dot org
2023-02-21  9:59 ` jakub at gcc dot gnu.org
2023-02-21 13:08 ` cvs-commit at gcc dot gnu.org
2023-02-21 13:08 ` rguenth at gcc dot gnu.org

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=bug-108691-4-YHZNQ6nbnF@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).