From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 2A0EC3856DE0 for ; Wed, 12 Oct 2022 07:24:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A0EC3856DE0 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 7FE3C28471D; Wed, 12 Oct 2022 09:24:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1665559442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gdWI3v/Nt7Q/DiE5JtMTRbC6rvCN/H1uSQQOPlj82R0=; b=EUh2RDaPUt9wS+sJM3GjWJHyL/tGmHo198azNqdyiVJic2qf6ZaDl8bg2yqy1Lpi0H2cXw 9dv9lPz8DyMYvgePOoY3gpYKyMrExftjBD5gHiSoQ1XA/blsGqm0qqqYSya2ipoa8YFfT+ 7ZufkWk1bmALoA4xMqkG2CKkTQR+Qhc= Date: Wed, 12 Oct 2022 09:24:02 +0200 From: Jan Hubicka To: Palmer Dabbelt Cc: richard.guenther@gmail.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2 2/3] doc: -falign-functions is ignored under -Os Message-ID: References: <20221011210156.7710-1-palmer@rivosinc.com> <20221011210156.7710-3-palmer@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221011210156.7710-3-palmer@rivosinc.com> X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,LIKELY_SPAM_BODY,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > 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 >