From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 35C5A3858C54; Wed, 18 Oct 2023 14:09:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35C5A3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697638146; bh=Zfzl1HqKzj8Q3DtzjLUcdHJk1F/iJSrJfexdC0EZBCE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sXIgc/6M4XA2wCukiJ4NofOCsC0yQeKX0QJJRjJFKI5fd01rcP3o3OuAqU0F+sSbj Y9jYdS4DIsW+brLoi96yYC+XPgvNjc9SGgzRH63Bwb3PRre+97ip1HQQVjT6KfyQrn czXCZd8x7EUS5alD7EtMglq6lRnHb/1HNrk8lbGM= From: "vlad at solidsands dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/111773] Inconsistent optimization of replaced operator new() Date: Wed, 18 Oct 2023 14:09: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: 13.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vlad at solidsands dot nl X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 #6 from Vlad Yaglamunov --- I agree with Richard's explanation. Seems like my first example is an undef= ined behavior. In section [basic.stc.dynamic.allocation] par 2, in C++17, was ad= ded the following: "Furthermore, for the library allocation functions in [new.delete.single] and [new.delete.array], p0 shall represent the address = of a block of storage disjoint from the storage for any other object accessible = to the caller."=