https://bugs.llvm.org/show_bug.cgi?id=49604

            Bug ID: 49604
           Summary: Implement the -Winvalid-memory-model
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangb...@nondot.org
          Reporter: antosh...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

C/C++ memory model is hard and people do a lot of errors with it. A warning
from compiler could be very useful for cases when particular memory order
should not be used with particular atomic operation. Foe example
* store operations and memory_order_acquire or memory_order_acq_rel
* load operations and memory_order_release or memory_order_acq_rel
* CAS and memory_order_release or memory_order_acq_rel

Some compilers already implement such warning with -Winvalid-memory-model flag.

Godbolt Playground: https://godbolt.org/z/79bf19
GCC related tikets: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69104 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99612

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to