public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Martin Sebor <msebor@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] enable -Winvalid-memory-order for C++ [PR99612]
Date: Wed, 8 Dec 2021 17:14:08 +0000	[thread overview]
Message-ID: <CACb0b4kN5D4mcCtk-F-WhGS+C7R1jkLWx5nBMEZkHa7nqpzEyg@mail.gmail.com> (raw)
In-Reply-To: <efdaf72b-15b8-84b8-b174-fd4d25c7de31@gmail.com>

On Wed, 8 Dec 2021 at 16:49, Martin Sebor wrote:
> I don't anticipate this change to lead to the same fallout
> because it's unlikely for GCC to synthesize invalid memory
> orders out of thin air;

Agreed. I don't think we'll have the same kind of issues. 99% of uses
of memory orders just use the constants explicitly, passing them
directly to the std::atomic member functions (or something that calls
them).

>and b) because the current solution
> can only detect the problems in calls to atomic functions at
> -O0 that are declared with attribute always_inline.  This
> includes member functions defined in the enclosing atomic
> class but not namespace-scope functions.  To make
> the detection possible those would also have to be
> always_inline.  If that's a change you'd like to see I can
> look into making it happen.

I think we can ignore the namespace-scope functions in <atomic>. Most people do.


  reply	other threads:[~2021-12-08 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 16:49 Martin Sebor
2021-12-08 17:14 ` Jonathan Wakely [this message]
2021-12-08 18:12   ` Martin Sebor
2021-12-15 15:30 ` PING " Martin Sebor
2021-12-23 23:20 ` Jeff Law
2022-01-05  8:45 ` Martin Liška
2022-01-05 20:34   ` Martin Sebor
2022-01-27 23:47 ` Andrew Pinski
2022-01-27 23:48   ` Andrew Pinski
2022-01-28  0:59   ` Martin Sebor
2022-01-28 11:05     ` Jonathan Wakely

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=CACb0b4kN5D4mcCtk-F-WhGS+C7R1jkLWx5nBMEZkHa7nqpzEyg@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    /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).