public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N)))
@ 2022-10-07 13:49 Palmer Dabbelt
  2022-10-10  6:07 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Palmer Dabbelt @ 2022-10-07 13:49 UTC (permalink / raw)
  To: gcc-patches, hubicka, richard.guenther; +Cc: Palmer Dabbelt

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(-)

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N)))
  2022-10-07 13:49 [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N))) Palmer Dabbelt
@ 2022-10-10  6:07 ` Richard Biener
  2022-10-11 21:02   ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2022-10-10  6:07 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: gcc-patches, hubicka

On Fri, Oct 7, 2022 at 3:50 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.

Maybe also mention that the alignment doesn't apply to functions
optimized for size?

> 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N)))
  2022-10-10  6:07 ` Richard Biener
@ 2022-10-11 21:02   ` Palmer Dabbelt
  0 siblings, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2022-10-11 21:02 UTC (permalink / raw)
  To: richard.guenther; +Cc: gcc-patches, hubicka

On Sun, 09 Oct 2022 23:07:21 PDT (-0700), richard.guenther@gmail.com wrote:
> On Fri, Oct 7, 2022 at 3:50 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.
>
> Maybe also mention that the alignment doesn't apply to functions
> optimized for size?

Oops, I guess that was the whole point of the discussion ;).  I sent a 
v2, which also mentions -Os but not sure we need to do that explicitly.

>
>> 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
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-11 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07 13:49 [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N))) Palmer Dabbelt
2022-10-10  6:07 ` Richard Biener
2022-10-11 21:02   ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).