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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
C testcase:
static inline int
foo (int *p, int m, int n)
{
  int q = 0;
  return __atomic_compare_exchange_n (p, &q, 42, 0, m, n);
}

int
bar (int *p)
{
  return foo (p, __ATOMIC_RELAXED, __ATOMIC_RELEASE);
}

I guess the fix is easy, pass_waccess::check_atomic_builtin needs to check
BUILT_IN_TSAN_ATOMIC* in addition to BUILT_IN_ATOMIC* and BUILT_IN_SYNC*, and
pass_waccess::check_call IFN_ATOMIC* calls.

But the question is if we should do it for GCC 16 and how should it interact
with
C++17 P0418R2 (if such model combinations are valid in C++ when using <atomic>,
I think the header needs to replace the invalid for __atomic* combinations with
valid ones).

Reply via email to