From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 237663858414 for ; Fri, 10 Feb 2023 18:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 237663858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 31AIrAeZ078459 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 10 Feb 2023 10:53:10 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 31AIrA81078458; Fri, 10 Feb 2023 10:53:10 -0800 (PST) (envelope-from sgk) Date: Fri, 10 Feb 2023 10:53:10 -0800 From: Steve Kargl To: Rimvydas Jasinskas Cc: Rimvydas Jasinskas via Fortran Subject: Re: Support for NOINLINE attribute Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Feb 10, 2023 at 10:38:04AM +0200, Rimvydas Jasinskas wrote: > On Fri, Feb 10, 2023 at 10:24 AM Steve Kargl via Fortran > wrote: > > > would it be possible to extend gfortran attribute support to handle > > > NOINLINE too? Like: "!GCC$ ATTRIBUTES noinline :: ...". > > > > It looks to me like you are conflating three independent topics. > > What does NOINLINE have to do with WEAK? What does WEAK have > > to do with NORETURN? > > As I wrote these are optional (different issues, quite useful to have > but still easy to work around with different means), the main issue is > still missing NOINLINE for -flto. Unfortunately, conflating unrelated topics can lead to distraction. I do however see value in NORETURN. I suppose a person writing a library may find WEAK useful. > > More importantly what is the effect of NOINLINE if a user > > does not specify the -flto option? Does this block inlining > > regardless of LTO? > > > > -- > > steve > Yes, there is no way to differentiate between LTO and non-LTO > compilations (at least from what I have seen in the code). > As long as subroutines/functions are in separate compilation units, > this has no effect for non-LTO builds anyway. Main issue is to deal > with unintentional over inlining between different compilation units > with lto1 backend. I haven't studied your patch in detail, so apologies up front if this is already available. Can attribute be applied to only a block of code in a file?. Suppose there are 3 functions in a file. Can the attribute be toggled on and off? Something like function bar() ... end function bar() !GCC$ ATTRIBUTES noinline on function foo() ... end function foo() !GCC$ ATTRIBUTES noinline off function bah() ... end function bah() bar() and bah() can be inlined while inlining foo() is prevented. -- Steve