public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/110137] implement clang -fassume-sane-operator-new
Date: Tue, 04 Jun 2024 11:57:08 +0000	[thread overview]
Message-ID: <bug-110137-4-NfE0IpIwG6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110137-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110137

--- Comment #13 from Jan Hubicka <hubicka at ucw dot cz> ---
> Is the option supposed to be only about the standard global scope operator
> new/delete (_Znam etc.) or also user operator new/delete class methods?  If the
> former, then I agree it is a global property (or at least a per shared
> library/binary property, one can arrange stuff with symbol visibility etc.).
> Otherwise it is a property of whatever operator new/delete you call.
> I think DECL_IS_OPERATOR_{NEW,DELETE} is set on both of these, the standard
> ones have
> also DECL_IS_REPLACEABLE_OPERATOR flag on them.
> Anyway, handling this just in IRA doesn't seem to be enough, surely it should
> be also handled during alias analysis etc.

I can add the TBAA and IPA bits (actually have WIP patch for that
already).  But there is also __builtion_operator_new and
__builtin_operator_delete that tags sanity of new/delete with per-call
sensitivity (since calls originating from std library are more opaque
then direct calls done by users).  So we need per-call sensitivity
anyway which can be done by altenrative decl or flag in gimple_call.

If user is crazy enough to do fancy tricks in new/delete I think it may
be controlled by program state or so (so for some code new/delete may be
sane while for other code it does not need to be0

So having this working well with LTO is IMO reasonable thing to do from
QOI point of view...

  parent reply	other threads:[~2024-06-04 11:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  8:15 [Bug c++/110137] New: " rguenth at gcc dot gnu.org
2023-06-06  8:17 ` [Bug c++/110137] " rguenth at gcc dot gnu.org
2023-06-09 12:22 ` redi at gcc dot gnu.org
2023-08-02  4:20 ` hiraditya at msn dot com
2023-08-02  6:56 ` redi at gcc dot gnu.org
2023-08-02  8:24 ` rguenther at suse dot de
2024-05-27  3:07 ` user202729 at protonmail dot com
2024-05-27  7:47 ` redi at gcc dot gnu.org
2024-06-04 10:16 ` user202729 at protonmail dot com
2024-06-04 10:39 ` hubicka at ucw dot cz
2024-06-04 11:31 ` redi at gcc dot gnu.org
2024-06-04 11:37 ` redi at gcc dot gnu.org
2024-06-04 11:45 ` jakub at gcc dot gnu.org
2024-06-04 11:57   ` Jan Hubicka
2024-06-04 11:57 ` hubicka at ucw dot cz [this message]
2024-06-05  8:23 ` user202729 at protonmail dot com
2024-06-05 13:00 ` hubicka at ucw dot cz
2024-06-23 18:14 ` user202729 at protonmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110137-4-NfE0IpIwG6@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).