From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49C15385E014; Wed, 25 Mar 2020 10:44:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49C15385E014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585133093; bh=U+JHo0EHKT4NCU3uRj1I10gljcR1acBEj/EWDj/k0a0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wvJHuLHhZvBjSTWrkJqy3nP/5zr5ZC759UcUJtmsiUTloDzUlb4HW2oncbPDcl7MU Gjim61EN+9NNvyATk039KX2R9IwUMT8kW3HpQng58cX751Nghqn+3dLXAyvrZ6Pj4e 52wncuMsGD3HcUn1p6d03cwx1gG6b2/C52aJbo1E= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94314] [10 Regression] Optimizing mismatched new/delete pairs since r10-2106-g6343b6bf3bb83c87 Date: Wed, 25 Mar 2020 10:44:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.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 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: Wed, 25 Mar 2020 10:44:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94314 --- Comment #4 from Richard Biener --- (In reply to Martin Li=C5=A1ka from comment #3) > Yes, I remember we discussed the topic about the user-provided new/delete > implementations. Can please Jason or Jonathan comment about the test-case? The testcase is certainly valid. The issue is we're matching new/delete pairs by means of dataflow (the new resulting pointer is fed to the delete) and identify new/delete by the decls flag. But that doesn't catch the case in this PR where there is a mismatch between the new/delete calls. Now - the question is if whether class-specific operator new/delete even have to "match" in this sense or how it's possible to "match" at all. I think the frontend has to provide some "link" between the new/delete decls to make this work (which is then quite heavy - an extra pointer in function decls) :/=