Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 12 warning: Invalid memory model #160

Open
riptl opened this issue Jul 25, 2022 · 0 comments
Open

GCC 12 warning: Invalid memory model #160

riptl opened this issue Jul 25, 2022 · 0 comments

Comments

@riptl
Copy link

riptl commented Jul 25, 2022

Describe the bug

Compiler warning invalid-memory-model triggered on atomic_base.h.

To Reproduce

Compile with GCC 12.

Expected behavior

No warnings

Environment (please complete the following information):

  • Operating System and Version: macOS 12.4, amd64, Bazel, Homebrew GCC 12.1.0_1, C++17 mode

Logs

In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = int]',
    inlined from 'void Bloomberg::quantum::Task::SuspensionGuard::set(int)' at external/com_bloomberg_quantum/quantum/quantum_task.h:131:34:
/usr/local/Cellar/gcc@12/12.1.0_1/bin/../lib/gcc/12/gcc/x86_64-apple-darwin21/12/../../../../../../include/c++/12/bits/atomic_base.h:464:25: warning: invalid memory model 'memory_order_acq_rel' for 'void __atomic_store_4(volatile void*, unsigned int, int)' [-Winvalid-memory-model]
  464 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/gcc@12/12.1.0_1/bin/../lib/gcc/12/gcc/x86_64-apple-darwin21/12/../../../../../../include/c++/12/bits/atomic_base.h:464:25: note: valid models are 'memory_order_relaxed', 'memory_order_seq_cst', 'memory_order_release'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant