diff options
author | Martin Sebor <msebor@redhat.com> | 2016-01-05 02:53:10 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2016-01-04 19:53:10 -0700 |
commit | 56f2741b1719eaf565ec751c78aefbb15a258a15 (patch) | |
tree | 2198f8d53e78abb280bb41a8fb73aa591b46043d /gcc | |
parent | 9676acebc23c1b2eb09e1054aabfe53ee2884588 (diff) | |
download | gcc-56f2741b1719eaf565ec751c78aefbb15a258a15.zip gcc-56f2741b1719eaf565ec751c78aefbb15a258a15.tar.gz gcc-56f2741b1719eaf565ec751c78aefbb15a258a15.tar.bz2 |
* doc/invoke.texi (Warning Options): Document -Winvalid-memory-model.
From-SVN: r232070
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 22 |
2 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4e9eb23..4ec3229 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-01-04 Martin Sebor <msebor@redhat.com> + + * doc/invoke.texi (Warning Options): Document -Winvalid-memory-model. + 2016-01-04 Michael Meissner <meissner@linux.vnet.ibm.com> * config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8b3d006..1d1fd87 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -260,7 +260,7 @@ Objective-C and Objective-C++ Dialects}. -Wignored-qualifiers -Wincompatible-pointer-types @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol -Winit-self -Winline -Wno-int-conversion @gol --Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol +-Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof @gol -Winvalid-pch -Wlarger-than=@var{len} @gol -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args @gol @@ -4305,6 +4305,26 @@ to compute a value that itself is never used, because such computations may be deleted by data flow analysis before the warnings are printed. +@item -Winvalid-memory-model +@opindex Winvalid-memory-model +@opindex Wno-invalid-memory-model +Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins}, +and the C11 atomic generic functions with a memory consistency argument +that is either invalid for the operation or outside the range of values +of the @code{memory_order} enumeration. For example, since the +@code{__atomic_store} and @code{__atomic_store_n} built-ins are only +defined for the relaxed, release, and sequentially consistent memory +orders the following code is diagnosed: + +@smallexample +void store (int *i) +@{ + __atomic_store_n (i, 0, memory_order_consume); +@} +@end smallexample + +@option{-Winvalid-memory-model} is enabled by default. + @item -Wmaybe-uninitialized @opindex Wmaybe-uninitialized @opindex Wno-maybe-uninitialized |