[v2,1/3] doc: -falign-functions doesn't override the __attribute__((align(N)))

Message ID 20221011210156.7710-2-palmer@rivosinc.com
State New
Headers
Series doc: -falign-functions improvements |

Commit Message

Palmer Dabbelt Oct. 11, 2022, 9:01 p.m. UTC
  I found this when reading the documentation for Kito's recent patch.
From the discussion it sounds like this is the desired behavior, so
let's document it.

gcc/doc/ChangeLog

	* invoke.texi (-falign-functions): Mention __align__
---
 gcc/doc/invoke.texi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Richard Biener Nov. 14, 2022, 2:54 p.m. UTC | #1
On Tue, Oct 11, 2022 at 11:02 PM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>
> I found this when reading the documentation for Kito's recent patch.
> From the discussion it sounds like this is the desired behavior, so
> let's document it.

OK.

> gcc/doc/ChangeLog
>
>         * invoke.texi (-falign-functions): Mention __align__
> ---
>  gcc/doc/invoke.texi | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 2a9ea3455f6..8326a60dcf1 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -13136,7 +13136,9 @@ effective only in combination with @option{-fstrict-aliasing}.
>  Align the start of functions to the next power-of-two greater than or
>  equal to @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at
>  least the first @var{m} bytes of the function can be fetched by the CPU
> -without crossing an @var{n}-byte alignment boundary.
> +without crossing an @var{n}-byte alignment boundary.  This does not override
> +functions that otherwise specify their own alignment constraints, such as via
> +an alignment attribute.
>
>  If @var{m} is not specified, it defaults to @var{n}.
>
> --
> 2.34.1
>
  

Patch

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2a9ea3455f6..8326a60dcf1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -13136,7 +13136,9 @@  effective only in combination with @option{-fstrict-aliasing}.
 Align the start of functions to the next power-of-two greater than or
 equal to @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at
 least the first @var{m} bytes of the function can be fetched by the CPU
-without crossing an @var{n}-byte alignment boundary.
+without crossing an @var{n}-byte alignment boundary.  This does not override
+functions that otherwise specify their own alignment constraints, such as via
+an alignment attribute.
 
 If @var{m} is not specified, it defaults to @var{n}.