From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EDC9D3857362; Fri, 29 Apr 2022 15:39:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDC9D3857362 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/100413] [11/12/13 Regression] ICE: failed to reclaim unneeded function with custom flags since r11-4267-g0e590b68fa374365 Date: Fri, 29 Apr 2022 15:39:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 15:39:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100413 --- Comment #8 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:27ee75dbe81bb781214c66a9e6a759c08b7deb60 commit r13-48-g27ee75dbe81bb781214c66a9e6a759c08b7deb60 Author: Martin Jambor Date: Fri Apr 29 17:38:15 2022 +0200 ipa: Release body of clone_of when removing its last clone (PR 100413) In the PR, the verifier complains that we did not manage to remove the body of a node and it is right. The node is kept for materialization of two clones but after one is materialized, the other one is removed as unneeded (as a part of delete_unreachable_blocks_update_callgraph). The problem is that the node removal does not check for this situation and can leave the clone_of node there with a body attached to it even though there is no use for it any more. This patch does checks for it and handles the situation in a simlar way that cgraph_node::materialize_clone does it, except that it also has to be careful that the removed node itself does not have any clones, which would still need the clone_of's body. Failing to do that results in a bootstrap failure. gcc/ChangeLog: 2022-04-27 Martin Jambor PR ipa/100413 * cgraph.cc (cgraph_node::remove): Release body of the node this is clone_of if appropriate. gcc/testsuite/ChangeLog: 2022-04-27 Martin Jambor PR ipa/100413 * g++.dg/ipa/pr100413.C: New test.=