From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D6F438708D6; Tue, 4 Jun 2024 10:39:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D6F438708D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717497581; bh=dQWILnLf4d77K1wCl4R4laKzIjTMj4u90F2sRjKXbNk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kE1/L4oOkqzahrJhr0xreWy6nvtduM+qZQdS8DOl7lVbAjZsYjSZ7YOEkLdSGrkAa kW64/qmsUuEuLPKcpGh/Xj9IrHmaeKuOuyv+gCLwACqX4v1c+5IM/eoYHAGRlk69lf WMqcdL2Fa7GzL4+Pml9+tbf0Gu9bJlgUn7rocB+g= From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110137] implement clang -fassume-sane-operator-new Date: Tue, 04 Jun 2024 10:39:40 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: NEW 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=3D110137 --- Comment #9 from Jan Hubicka --- Doing global flag has a problem since with LTO or using optimize attribute user may mix code compiled with and without sane operator new.=20= =20 When function with insane operator new gets inlined to a function with sane, we will assume sanity for calls that technically may not be sane. So I think we do need to tag the declaration or call instead of using flag_sane_operator_new in middle-end...=