From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 884AE385E008; Wed, 25 Mar 2020 11:24:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 884AE385E008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585135485; bh=D0enmpjPRRLt6/x85RxCRnpRv5UkJ2N/dWbPbXy606c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=taKiJKqUblTiqTZdh4y3FUhRLrGzTX3BOwf54C9IUwo3uBU0H48kExoVA2ZwXrG9H 7TBr5UwnOna15T1Q0s9BDUOsfFcF2j+iXK/Yj/oMQAxyyuTzEp7+pb5MIwk08ctiMB rEjFpBcRelGjR+XLZhJOIFjha/V0LPh2pyH+76B4= From: "glisse 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 11:24:45 +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: glisse 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 11:24:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94314 --- Comment #5 from Marc Glisse --- I don't think we need heavy machinery linking new and delete (and if we did= I'd be tempted to store it in some global table rather than in the nodes). The = most important case is the global replacable functions, for which we have a fini= te list, and for those a few checks like not matching array with non-array versions should do. For user overloads with attribute malloc (a gcc extensi= on), I would go with heuristics like both/neither being class members, being mem= bers of the same class, etc. Although I am not quite sure how doable that is from the middle-end, how much of that information is still available (I think it= is available in the mangled name, but demangling doesn't seem like a great ide= a).=