From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E64623858D35; Thu, 25 Nov 2021 13:29:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E64623858D35 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/103052] [9/10/11 Regression] Function is found to be pure looping but has a call to a noreturn function in it Date: Thu, 25 Nov 2021 13:29:05 +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: 10.3.0 X-Bugzilla-Keywords: wrong-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: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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: Thu, 25 Nov 2021 13:29:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103052 --- Comment #15 from CVS Commits --- The releases/gcc-9 branch has been updated by Jan Hubicka : https://gcc.gnu.org/g:3d1f5e86fb4351a109d45fe441b1b00d6e56c277 commit r9-9844-g3d1f5e86fb4351a109d45fe441b1b00d6e56c277 Author: Jan Hubicka Date: Sun Nov 21 00:35:22 2021 +0100 Fix looping flag discovery in ipa-pure-const The testcase shows situation where there is non-trivial cycle in the callgraph involving a noreturn call. This cycle is important for const function discovery but not important for pure. IPA pure const uses same strongly connected components for both propagations which makes it to get suboptimal result (does not detect the pure flag). However local pure const gets the situation right becaue it processes functions in right order. This hits rarely executed code in propagate_pure_const that merge results with previously known state that has long standing bug in it that makes it to throw away the looping flag. Bootstrapped/regtested x86_64-linux. gcc/ChangeLog: 2021-11-21 Jan Hubicka PR ipa/103052 * ipa-pure-const.c (propagate_pure_const): Fix merging of loping flag. gcc/testsuite/ChangeLog: 2021-11-21 Jan Hubicka PR ipa/103052 * gcc.c-torture/execute/pr103052.c: New test. (cherry picked from commit a0e99d5bb741d3db74a67d492f47b28217fbf88a)=