]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Improve __atomic_clear/test_and_set documentation
authorAndi Kleen <ak@linux.intel.com>
Fri, 21 Jun 2013 13:51:37 +0000 (13:51 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Fri, 21 Jun 2013 13:51:37 +0000 (13:51 +0000)
Document that __atomic_clear and __atomic_test_and_set should
only be used with bool.

gcc/:
2013-06-21  Andi Kleen  <ak@linux.intel.com>

* doc/extend.texi: Document that __atomic_clear and
  __atomic_test_and_set should only be used with bool.

From-SVN: r200303

gcc/ChangeLog
gcc/doc/extend.texi

index c18f056d06e2e6675c3877dcf42723454d3feb6c..16590940a0dde969547f8f054f655510e3d944aa 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-21  Andi Kleen  <ak@linux.intel.com>
+
+       * doc/extend.texi: Document that __atomic_clear and
+         __atomic_test_and_set should only be used with bool.
+
 2013-06-20  Jan Hubicka  <jh@suse.cz>
 
        * gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Use
index 6ce26efbe1e2e31557482d5eac380941515b07a2..213cf00a7385eb650282cd9488d6685820ce5804 100644 (file)
@@ -7439,6 +7439,8 @@ This built-in function performs an atomic test-and-set operation on
 the byte at @code{*@var{ptr}}.  The byte is set to some implementation
 defined nonzero ``set'' value and the return value is @code{true} if and only
 if the previous contents were ``set''.
+It should be only used for operands of type @code{bool} or @code{char}. For 
+other types only part of the value may be set.
 
 All memory models are valid.
 
@@ -7448,6 +7450,10 @@ All memory models are valid.
 
 This built-in function performs an atomic clear operation on
 @code{*@var{ptr}}.  After the operation, @code{*@var{ptr}} contains 0.
+It should be only used for operands of type @code{bool} or @code{char} and 
+in conjunction with @code{__atomic_test_and_set}.
+For other types it may only clear partially. If the type is not @code{bool}
+prefer using @code{__atomic_store}.
 
 The valid memory model variants are
 @code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, and