Re: [PATCH v2 2/3] doc: -falign-functions is ignored under -Os
> 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 >
Re: [PATCH v2 2/3] doc: -falign-functions is ignored under -Os
On Tue, Oct 11, 2022 at 5:03 PM Palmer Dabbelt wrote: > > 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 Since there's -Oz now, too, should that be mentioned as well? > --- > 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}. > > @item -flimit-function-alignment > If this option is enabled, the compiler tries to avoid unnecessarily > -- > 2.34.1 >
[PATCH v2 2/3] doc: -falign-functions is ignored under -Os
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}. @item -flimit-function-alignment If this option is enabled, the compiler tries to avoid unnecessarily -- 2.34.1