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 ipa/107300] [13 Regression] ICE: verify_ssa failed (error: virtual definition of statement not up to date)
Date: Thu, 02 Feb 2023 09:55:41 +0000	[thread overview]
Message-ID: <bug-107300-4-nKtGPNNNPP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107300-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:d2423144eb36a68fd0da9224857ce807714874a7

commit r13-5645-gd2423144eb36a68fd0da9224857ce807714874a7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 2 10:54:54 2023 +0100

    Replace IFN_TRAP with BUILT_IN_UNREACHABLE_TRAP [PR107300]

    For PR106099 I've added IFN_TRAP as an alternative to __builtin_trap
    meant for __builtin_unreachable purposes (e.g. with -funreachable-traps
    or some sanitizers) which doesn't need vops because __builtin_unreachable
    doesn't need them either.  This works in various cases, but unfortunately
    IPA likes to decide on the redirection to unreachable just by tweaking
    the cgraph edge to point to a different FUNCTION_DECL.  As internal
    functions don't have a decl, this causes problems like in the following
    testcase.

    The following patch fixes it by removing IFN_TRAP again and replacing
    it with user inaccessible BUILT_IN_UNREACHABLE_TRAP, so that e.g.
    builtin_decl_unreachable can return it directly and we don't need to tweak
    it later in wherever we actually replace the call stmt.

    2023-02-02  Jakub Jelinek  <jakub@redhat.com>

            PR ipa/107300
            * builtins.def (BUILT_IN_UNREACHABLE_TRAP): New builtin.
            * internal-fn.def (TRAP): Remove.
            * internal-fn.cc (expand_TRAP): Remove.
            * tree.cc (build_common_builtin_nodes): Define
            BUILT_IN_UNREACHABLE_TRAP if not yet defined.
            (builtin_decl_unreachable): Use BUILT_IN_UNREACHABLE_TRAP
            instead of BUILT_IN_TRAP.
            * gimple.cc (gimple_build_builtin_unreachable): Remove
            emitting internal function for BUILT_IN_TRAP.
            * asan.cc (maybe_instrument_call): Handle
BUILT_IN_UNREACHABLE_TRAP.
            * cgraph.cc (cgraph_edge::verify_corresponds_to_fndecl): Handle
            BUILT_IN_UNREACHABLE_TRAP instead of BUILT_IN_TRAP.
            * ipa-devirt.cc (possible_polymorphic_call_target_p): Handle
            BUILT_IN_UNREACHABLE_TRAP.
            * builtins.cc (expand_builtin, is_inexpensive_builtin): Likewise.
            * tree-cfg.cc (verify_gimple_call,
            pass_warn_function_return::execute): Likewise.
            * attribs.cc (decl_attributes): Don't report exclusions on
            BUILT_IN_UNREACHABLE_TRAP either.

            * gcc.dg/pr107300.c: New test.

  parent reply	other threads:[~2023-02-02  9:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  3:33 [Bug tree-optimization/107300] New: " asolokha at gmx dot com
2022-10-18  7:32 ` [Bug ipa/107300] [13 Regression] " rguenth at gcc dot gnu.org
2022-10-18  7:54 ` marxin at gcc dot gnu.org
2022-10-18  7:55 ` rguenth at gcc dot gnu.org
2022-10-19 17:34 ` pinskia at gcc dot gnu.org
2022-11-30 17:10 ` jakub at gcc dot gnu.org
2022-12-01 15:11 ` marxin at gcc dot gnu.org
2022-12-01 15:27 ` jakub at gcc dot gnu.org
2022-12-20 14:36 ` rguenth at gcc dot gnu.org
2023-02-02  9:55 ` cvs-commit at gcc dot gnu.org [this message]
2023-02-02 12:57 ` jakub 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-107300-4-nKtGPNNNPP@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).