From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B66613858417; Tue, 22 Nov 2022 17:30:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B66613858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669138228; bh=FquJoFB7A6Oza9xvRuPhGMSDT6SlAP2jafCbPAa2E1o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=U1XUyUXrZJOML7cES07ayviYTcNnSjsfgbaKbUfJXo98JjHoCivbRwEUphystjc8T KiUGuvtY2JNffgxQ/l2gLB28JjXNGChVOfXwlMBgJNDxoFKLEkdZPY7bI+tfecfl/c 5bCDfLLLH5X5iHGWj1o4E9bAsZIyZa9XWvgcTvYc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/107661] [13 Regression] lambdas get merged incorrectly in tempaltes, cause llvm-12 miscompilation since r13-3358-ge0403e95689af7 Date: Tue, 22 Nov 2022 17:30:28 +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: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107661 --- Comment #16 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:c4a92a9117a034e7cf291ae51d8b9b844fb5a88b commit r13-4238-gc4a92a9117a034e7cf291ae51d8b9b844fb5a88b Author: Martin Jambor Date: Tue Nov 22 18:22:03 2022 +0100 ipa-cp: Do not be too optimistic about self-recursive edges (PR 107661) PR 107661 shows that function push_agg_values_for_index_from_edge should not attempt to optimize self-recursive call graph edges when called from cgraph_edge_brings_all_agg_vals_for_node. Unlike when being called from find_aggregate_values_for_callers_subset, we cannot expect that any cloning for constants would lead to the edge leading from a new clone to the same new clone, in this case it would only be redirected to a new callee. Fixed by adding a parameter to push_agg_values_from_edge whether being optimistic about self-recursive edges is possible. gcc/ChangeLog: 2022-11-22 Martin Jambor PR ipa/107661 * ipa-cp.cc (push_agg_values_from_edge): New parameter optimize_self_recursion, use it to decide whether to pass inter= im to the helper function. (find_aggregate_values_for_callers_subset): Pass true in the new parameter of push_agg_values_from_edge. (cgraph_edge_brings_all_agg_vals_for_node): Pass false in the n= ew parameter of push_agg_values_from_edge. gcc/testsuite/ChangeLog: 2022-11-22 Martin Jambor PR ipa/107661 * g++.dg/ipa/pr107661.C: New test.=