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/98078] ICE in cgraph_add_edge_to_call_site_hash, at cgraph.c:698 since r6-1705-gd88511aec7338a93 Date: Wed, 17 Mar 2021 10:35:07 +0000 [thread overview] Message-ID: <bug-98078-4-mQHgj1WhSK@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-98078-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98078 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>: https://gcc.gnu.org/g:25fc4cb3ff7bb86d31ac886e04bbe5dd69db832e commit r9-9291-g25fc4cb3ff7bb86d31ac886e04bbe5dd69db832e Author: Martin Jambor <mjambor@suse.cz> Date: Wed Mar 17 11:32:50 2021 +0100 ipa: Fix resolving speculations through cgraph_edge::set_call_stmt In the PR 98078 testcase, speculative call-graph edges which were created by IPA-CP are confirmed during inlining but cgraph_edge::set_call_stmt does not take it very well. The function enters the update_speculative branch and updates the edges in the speculation bundle separately (by a recursive call), but when it processes the first direct edge, most of the bundle actually ceases to exist because it is devirtualized. It nevertheless goes on to attempt to update the indirect edge (that has just been removed), which surprisingly gets as far as adding the edge to the call_site_hash, the same devirtualized edge for the second time, and that triggers an assert. Fixed by this patch which makes the function aware that it is about to resolve a speculation and do so instead of updating components of speculation. Also, it does so before dealing with the hash because the speculation resolution code needs the hash to point to the first speculative direct edge and also cleans the hash up by calling update_call_stmt_hash_for_removing_direct_edge. Bootstrapped and tested on x86_64-linux, also profile-LTO-bootstrapped on the same system. gcc/ChangeLog: 2021-01-20 Martin Jambor <mjambor@suse.cz> PR ipa/98078 * cgraph.c (cgraph_edge::set_call_stmt): Do not update all corresponding speculative edges if we are about to resolve speculation. Make edge direct (and so resolve speculations) before removing it from call_site_hash. (cgraph_edge::make_direct): Relax the initial assert to allow calling the function on speculative direct edges. (cherry picked from commit b8188b7d7382e4a74af5dd6a125e76e8d43a68a5)
next prev parent reply other threads:[~2021-03-17 10:35 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-01 10:09 [Bug ipa/98078] New: " marxin at gcc dot gnu.org 2020-12-01 10:09 ` [Bug ipa/98078] " marxin at gcc dot gnu.org 2020-12-01 10:10 ` marxin at gcc dot gnu.org 2021-01-18 19:21 ` jamborm at gcc dot gnu.org 2021-01-21 10:02 ` jamborm at gcc dot gnu.org 2021-03-05 16:42 ` cvs-commit at gcc dot gnu.org 2021-03-05 16:54 ` jamborm at gcc dot gnu.org 2021-03-16 15:44 ` cvs-commit at gcc dot gnu.org 2021-03-17 10:35 ` cvs-commit at gcc dot gnu.org [this message] 2021-03-17 10:36 ` jamborm 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-98078-4-mQHgj1WhSK@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: linkBe 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).