From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by sourceware.org (Postfix) with ESMTPS id 3D8023852C70 for ; Mon, 21 Nov 2022 11:24:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D8023852C70 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([2.10.193.163]) by smtp.orange.fr with ESMTPA id x4uJoB5e7teqGx4uJoI23z; Mon, 21 Nov 2022 12:24:12 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Mon, 21 Nov 2022 12:24:12 +0100 X-ME-IP: 2.10.193.163 Message-ID: <7b9995a0-792a-8931-a2cd-6bf89130d5bd@orange.fr> Date: Mon, 21 Nov 2022 12:24:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH 2/2] Fortran: Add attribute flatten Content-Language: fr To: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gfortran ML References: <20221110102031.1366016-1-aldot@gcc.gnu.org> <20221110102031.1366016-3-aldot@gcc.gnu.org> From: Mikael Morin In-Reply-To: <20221110102031.1366016-3-aldot@gcc.gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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: Le 10/11/2022 à 11:20, Bernhard Reutner-Fischer via Fortran a écrit : > Bootstrapped and regtested cleanly on x86_unknown-linux. > The document bits will be rewritten for rst. > Ok for trunk if the prerequisite target_clones patch is approved? > > gcc/fortran/ChangeLog: > > * decl.cc (gfc_match_gcc_attributes): Handle flatten. > * f95-lang.cc (gfc_attribute_table): Add flatten. > * gfortran.texi: Document attribute flatten. > > gcc/testsuite/ChangeLog: > > * gfortran.dg/attr_flatten-1.f90: New test. > --- > gcc/fortran/decl.cc | 8 +++- > gcc/fortran/f95-lang.cc | 2 + > gcc/fortran/gfortran.texi | 8 ++++ > gcc/testsuite/gfortran.dg/attr_flatten-1.f90 | 41 ++++++++++++++++++++ > 4 files changed, 57 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/gfortran.dg/attr_flatten-1.f90 > > diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc > index d312d4812b6..3d210c26eb5 100644 > --- a/gcc/fortran/decl.cc > +++ b/gcc/fortran/decl.cc (...) > @@ -11849,7 +11850,9 @@ gfc_match_gcc_attributes (void) > if (strcmp (name, ext_attr_list[id].name) == 0) > break; > > - if (id == EXT_ATTR_LAST) > + if (strcmp (name, "flatten") == 0) > + known_attr0args = true; /* Handled below. We do not need a bit. */ I don't see the point to have all the attributes needing a bit except one that doesn't but needs a specific handling. What does it look like without the 1/2 patch and if one bit is also used for flatten, like the other attributes? > + else if (id == EXT_ATTR_LAST) > { > gfc_error ("Unknown attribute in !GCC$ ATTRIBUTES statement at %C"); > return MATCH_ERROR; > diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi > index 06e4c8c00a1..be650f28b62 100644 > --- a/gcc/fortran/gfortran.texi > +++ b/gcc/fortran/gfortran.texi > @@ -3280,6 +3280,14 @@ contains > end module mymod > @end smallexample > > +@node flatten > + > +Procedures annotated with the @code{flatten} attribute have their > +callees inlined, if possible. I'm not a native speaker, but I find this sentence confusing. The words of the gcc manual you are refering to seem more clear: "every call inside the function is inlined, if possible". > +Please refer to > +@ref{Top,,Common Function Attributes,gcc,Using the GNU Compiler Collection (GCC)} > +for details about the respective attribute. > + > The attributes are specified using the syntax > > @code{!GCC$ ATTRIBUTES} @var{attribute-list} @code{::} @var{variable-list}