From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7EA73858025; Fri, 13 Oct 2023 06:34:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7EA73858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697178888; bh=ihtPXzLYQY1w+94gq0UDhHNkXqBP4MbdVS5nfTevrls=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d7KKFELiHd2TUwKEKPw3cKjaalwyGX8x6pWqAquYVzEx8mZ+FSyJF0e8B8LIbndtx njNW0DSunFd8YnZn/CB6cTvbnLZPoW/3e4UsNsZs7PU3EdttJLaUqXy0v372AUcqss 3ct8X/5OMdC43oQ4q5v6+rED3O3iQ4q32zVr3Z3c= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/111773] Inconsistent optimization of replaced operator new() Date: Fri, 13 Oct 2023 06:34: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: 13.2.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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D111773 --- Comment #4 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:35b5bb475375dba4ea9101d6db13a6012c4e84ca commit r14-4611-g35b5bb475375dba4ea9101d6db13a6012c4e84ca Author: Richard Biener Date: Thu Oct 12 10:13:58 2023 +0200 tree-optimization/111773 - avoid CD-DCE of noreturn special calls The support to elide calls to allocation functions in DCE runs into the issue that when implementations are discovered noreturn we end up DCEing the calls anyway, leaving blocks without termination and without outgoing edges which is both invalid IL and wrong-code when as in the example the noreturn call would throw. The following avoids taking advantage of both noreturn and the ability to elide allocation at the same time. For the testcase it's valid to throw or return 10 by eliding the allocation. But we have to do either where currently we'd run off the function. PR tree-optimization/111773 * tree-ssa-dce.cc (mark_stmt_if_obviously_necessary): Do not elide noreturn calls that are reflected to the IL. * g++.dg/torture/pr111773.C: New testcase.=