]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
extend.texi (scalar_storage_order type attribute): Document restriction on type punni...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 22 Jan 2016 09:25:58 +0000 (09:25 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 22 Jan 2016 09:25:58 +0000 (09:25 +0000)
* doc/extend.texi (scalar_storage_order type attribute): Document
restriction on type punning and aliasing, and remove future tense.

From-SVN: r232718

gcc/ChangeLog
gcc/doc/extend.texi

index 113d8416768dbaa61c546dd11be36f6aafd57a57..ac617a9a0445c81581955da12c5fccd692fac9d2 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * doc/extend.texi (scalar_storage_order type attribute): Document
+       restriction on type punning and aliasing, and remove future tense.
+
 2016-01-21  Roman Zhuykov  <zhroma@ispras.ru>
 
        PR target/69252
index e11ce4d3e5a26bc5fc9917cac1c2b06078241840..7e079ff7285b8e23e314b2b1f251a819eacca6b0 100644 (file)
@@ -6496,22 +6496,26 @@ storage order with regard to the scalar storage order of the target:
 
 @itemize
 @item Taking the address of a scalar field of a @code{union} or a
-@code{struct} with reverse scalar storage order is not permitted and will
-yield an error.
+@code{struct} with reverse scalar storage order is not permitted and yields
+an error.
 @item Taking the address of an array field, whose component is scalar, of
 a @code{union} or a @code{struct} with reverse scalar storage order is
-permitted but will yield a warning, unless @option{-Wno-scalar-storage-order}
+permitted but yields a warning, unless @option{-Wno-scalar-storage-order}
 is specified.
 @item Taking the address of a @code{union} or a @code{struct} with reverse
 scalar storage order is permitted.
 @end itemize
 
 These restrictions exist because the storage order attribute is lost when
-the address of a scalar or the address of an array with scalar component
-is taken, so storing indirectly through this address will generally not work.
+the address of a scalar or the address of an array with scalar component is
+taken, so storing indirectly through this address generally does not work.
 The second case is nevertheless allowed to be able to perform a block copy
 from or to the array.
 
+Moreover, the use of type punning or aliasing to toggle the storage order
+is not supported; that is to say, a given scalar object cannot be accessed
+through distinct types that assign a different storage order to it.
+
 @item transparent_union
 @cindex @code{transparent_union} type attribute