public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: richard.guenther@gmail.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2 2/3] doc: -falign-functions is ignored under -Os
Date: Wed, 12 Oct 2022 09:24:02 +0200	[thread overview]
Message-ID: <Y0ZrkqjTNB8Hfg8E@kam.mff.cuni.cz> (raw)
In-Reply-To: <20221011210156.7710-3-palmer@rivosinc.com>

> This is implicitly mentioned in the docs, but there were some questions
> in a recent patch.  This makes it more exlicit that -falign-functions is
> meant to be ignored under -Os.
> 
> gcc/doc/ChangeLog
> 
> 	* invoke.texi (-falign-functions): Mention -Os
> ---
>  gcc/doc/invoke.texi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 8326a60dcf1..a24798d5029 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -13164,7 +13164,8 @@ equivalent and mean that functions are not aligned.
>  If @var{n} is not specified or is zero, use a machine-dependent default.
>  The maximum allowed @var{n} option value is 65536.
>  
> -Enabled at levels @option{-O2}, @option{-O3}.
> +Enabled at levels @option{-O2}, @option{-O3}.  This has no behavior under under
> +@option{-Os}.

Maybe we could instead say that the function alignment is included for
functions optimized for size.

This can happen by -Os, -Oz, cold attribute
or because we auto-detect function as cold (i.e. it unavoidably leads to
abort or is only called on such paths)

It would be also nice to mention that for other alignment options (align
jumps, loops and labels are ignored when given jump, loop or label is
optimized for size).

Honza
>  
>  @item -flimit-function-alignment
>  If this option is enabled, the compiler tries to avoid unnecessarily
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2022-10-12  7:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 21:01 [PATCH v2 0/3] doc: -falign-functions improvements Palmer Dabbelt
2022-10-11 21:01 ` [PATCH v2 1/3] doc: -falign-functions doesn't override the __attribute__((align(N))) Palmer Dabbelt
2022-11-14 14:54   ` Richard Biener
2022-10-11 21:01 ` [PATCH v2 2/3] doc: -falign-functions is ignored under -Os Palmer Dabbelt
2022-10-11 22:15   ` Eric Gallager
2022-10-12  7:24   ` Jan Hubicka [this message]
2022-10-11 21:01 ` [PATCH v2 3/3] doc: -falign-functions is ignored for cold/size-optimized functions Palmer Dabbelt
2022-11-14 14:54   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0ZrkqjTNB8Hfg8E@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=palmer@rivosinc.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).