Commit d8fdf280 by Sandra Loosemore Committed by Sandra Loosemore

re PR other/56334 (__attribute__((aligned)) documentation is misleading)

2018-11-15  Sandra Loosemore  <sandra@codesourcery.com>

	PR other/56334

	gcc/
	* doc/extend.texi (Common Function Attributes): Clarify linker
	restrictions on "aligned" attribute.
	(Common Variable Attributes): Likewise.  Mention that linker
	restrictions don't apply to stack-allocated variables.

From-SVN: r266170
parent 4822d9cb
2018-11-15 Sandra Loosemore <sandra@codesourcery.com>
PR other/56334
* doc/extend.texi (Common Function Attributes): Clarify linker
restrictions on "aligned" attribute.
(Common Variable Attributes): Likewise. Mention that linker
restrictions don't apply to stack-allocated variables.
2018-11-15 Joern Rennecke <joern.rennecke@riscy-ip.com> 2018-11-15 Joern Rennecke <joern.rennecke@riscy-ip.com>
* gensupport.c (add_predicate_code): Properly handle ZERO_EXTRACT * gensupport.c (add_predicate_code): Properly handle ZERO_EXTRACT
...@@ -2396,7 +2396,8 @@ alignment this overrides the effect of the ...@@ -2396,7 +2396,8 @@ alignment this overrides the effect of the
function. function.
Note that the effectiveness of @code{aligned} attributes may be Note that the effectiveness of @code{aligned} attributes may be
limited by inherent limitations in your linker. On many systems, the limited by inherent limitations in the system linker
and/or object file format. On some systems, the
linker is only able to arrange for functions to be aligned up to a linker is only able to arrange for functions to be aligned up to a
certain maximum alignment. (For some linkers, the maximum supported certain maximum alignment. (For some linkers, the maximum supported
alignment may be very very small.) See your linker documentation for alignment may be very very small.) See your linker documentation for
...@@ -6132,8 +6133,9 @@ attribute must be specified as well. When used as part of a typedef, the ...@@ -6132,8 +6133,9 @@ attribute must be specified as well. When used as part of a typedef, the
@code{aligned} attribute can both increase and decrease alignment, and @code{aligned} attribute can both increase and decrease alignment, and
specifying the @code{packed} attribute generates a warning. specifying the @code{packed} attribute generates a warning.
Note that the effectiveness of @code{aligned} attributes may be limited Note that the effectiveness of @code{aligned} attributes for static
by inherent limitations in your linker. On many systems, the linker is variables may be limited by inherent limitations in the system linker
and/or object file format. On some systems, the linker is
only able to arrange for variables to be aligned up to a certain maximum only able to arrange for variables to be aligned up to a certain maximum
alignment. (For some linkers, the maximum supported alignment may alignment. (For some linkers, the maximum supported alignment may
be very very small.) If your linker is only able to align variables be very very small.) If your linker is only able to align variables
...@@ -6141,6 +6143,9 @@ up to a maximum of 8-byte alignment, then specifying @code{aligned(16)} ...@@ -6141,6 +6143,9 @@ up to a maximum of 8-byte alignment, then specifying @code{aligned(16)}
in an @code{__attribute__} still only provides you with 8-byte in an @code{__attribute__} still only provides you with 8-byte
alignment. See your linker documentation for further information. alignment. See your linker documentation for further information.
Stack variables are not affected by linker restrictions; GCC can properly
align them on any target.
The @code{aligned} attribute can also be used for functions The @code{aligned} attribute can also be used for functions
(@pxref{Common Function Attributes}.) (@pxref{Common Function Attributes}.)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment